浏览代码

Added the past action input when using RNN with multi-discrete (#1124)

/develop-generalizationTraining-TrainerController
GitHub 6 年前
当前提交
e9c7c2ce
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 10
      unity-environment/Assets/ML-Agents/Scripts/CoreBrainInternal.cs

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


bool hasMaskedActions;
bool hasValueEstimate;
float[,] inputState;
int[] inputPrevAction;
int[,] inputPrevAction;
List<float[,,,]> observationMatrixList;
float[,] inputOldMemories;
float[,] maskedActions;

// Create the state tensor
if (hasPrevAction)
{
inputPrevAction = new int[currentBatchSize];
int totalNumberActions = brain.brainParameters.vectorActionSize.Length;
inputPrevAction = new int[currentBatchSize, totalNumberActions];
inputPrevAction[i] = Mathf.FloorToInt(actionList[0]);
for (var j = 0 ; j < totalNumberActions; j++)
{
inputPrevAction[i,j] = Mathf.FloorToInt(actionList[j]);
}
i++;
}
}

正在加载...
取消
保存