浏览代码

fix on the instanciation of coreBrains,

fix on the conversion of actions to arrays in the BrainInfo received from step
/develop-generalizationTraining-TrainerController
vincentpierre 7 年前
当前提交
65df8ae9
共有 2 个文件被更改,包括 18 次插入7 次删除
  1. 6
      python/unityagents/environment.py
  2. 19
      unity-environment/Assets/ML-Agents/Scripts/Brain.cs

6
python/unityagents/environment.py


rewards = state_dict["rewards"]
dones = state_dict["dones"]
agents = state_dict["agents"]
actions = state_dict["actions"]
# actions = state_dict["actions"]
if n_agent > 0 :
actions = np.array(state_dict["actions"]).reshape((n_agent, -1))
else :
actions = np.array([])
observations = []
for o in range(self._brains[b].number_observations):

19
unity-environment/Assets/ML-Agents/Scripts/Brain.cs


External,
Internal
}
Player,
Heuristic,
External,
Player,
Heuristic,
External,
}
#endif

public enum StateType
{
discrete,
continuous
}
continuous}
;
/** Only need to be modified in the brain's inpector.

{
foreach (BrainType bt in System.Enum.GetValues(typeof(BrainType)))
{
CoreBrains[(int)bt] = ScriptableObject.Instantiate(CoreBrains[(int)bt]);
if (CoreBrains[(int)bt] == null)
{
CoreBrains[(int)bt] = ScriptableObject.CreateInstance("CoreBrain" + bt.ToString());
}
else
{
CoreBrains[(int)bt] = ScriptableObject.Instantiate(CoreBrains[(int)bt]);
}
}
instanceID = gameObject.GetInstanceID();
}

正在加载...
取消
保存