浏览代码

Make comms one-hot

/comms-grad
Ervin Teng 4 年前
当前提交
e923a3cf
共有 2 个文件被更改,包括 14 次插入3 次删除
  1. 4
      Project/Assets/ML-Agents/Examples/Hallway/Prefabs/SymbolFinderArea.prefab
  2. 13
      Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayCollabAgent.cs

4
Project/Assets/ML-Agents/Examples/Hallway/Prefabs/SymbolFinderArea.prefab


m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 2
VectorObservationSize: 4
NumStackedVectorObservations: 3
m_ActionSpec:
m_NumContinuousActions: 0

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 2
VectorObservationSize: 4
NumStackedVectorObservations: 3
m_ActionSpec:
m_NumContinuousActions: 0

13
Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayCollabAgent.cs


{
sensor.AddObservation(StepCount / (float)MaxStep);
}
sensor.AddObservation(m_Message);
sensor.AddObservation(toOnehot(m_Message));
}
float[] toOnehot(int message)
{
float[] onehot = new float[3];
if (message < 0 || message >= 3)
{
return onehot;
}
onehot[message] = 1f;
return onehot;
}
public void tellAgent(int message)

正在加载...
取消
保存