浏览代码

need to convert the state to int if the state is discrete

/develop-generalizationTraining-TrainerController
vincentpierre 7 年前
当前提交
5390bb09
共有 1 个文件被更改,包括 18 次插入5 次删除
  1. 23
      unity-environment/Assets/ML-Agents/Scripts/CoreBrainInternal.cs

23
unity-environment/Assets/ML-Agents/Scripts/CoreBrainInternal.cs


public enum tensorType
{
Integer,
FloatingPoint
};
FloatingPoint}
;
public string name;
public tensorType valueType;

if (currentBatchSize == 0)
{
if (coord!=null)
if (coord != null)
{
coord.giveBrainInfo(brain);
}

}
if (coord!=null)
if (coord != null)
{
coord.giveBrainInfo(brain);
}

// Create the state tensor
if (hasState)
{
runner.AddInput(graph[graphScope + StatePlacholderName][0], inputState);
if (brain.brainParameters.stateSpaceType == StateType.discrete)
{
int[,] discreteInputState = new int[currentBatchSize, 1];
for (int i = 0; i < currentBatchSize; i++)
{
discreteInputState[i, 0] = (int)inputState[i, 0];
}
runner.AddInput(graph[graphScope + StatePlacholderName][0], discreteInputState);
}
else
{
runner.AddInput(graph[graphScope + StatePlacholderName][0], inputState);
}
}
// Create the observation tensors

正在加载...
取消
保存