浏览代码

Fixing curriculum reset parameter bug.

- The environment did not respond to reset parameter values
defined by a curriculum until the second reset. This was
because on the first reset, the reset parameters were not
updated by the Academy.
/develop-generalizationTraining-TrainerController
Deric Pang 6 年前
当前提交
65ef8f06
共有 1 个文件被更改,包括 14 次插入9 次删除
  1. 23
      unity-environment/Assets/ML-Agents/Scripts/Academy.cs

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


ConfigureEnvironment();
}
private void UpdateResetParameters()
{
var newResetParameters = brainBatcher.GetEnvironmentParameters();
if (newResetParameters != null)
{
foreach (var kv in newResetParameters.FloatParameters)
{
resetParameters[kv.Key] = kv.Value;
}
}
}
void HandleLog(string logString, string stackTrace, LogType type)
{
logWriter = new StreamWriter(logPath, true);

if (brainBatcher.GetCommand() ==
MLAgents.CommunicatorObjects.CommandProto.Reset)
{
// Update reset parameters.
var newResetParameters = brainBatcher.GetEnvironmentParameters();
if (newResetParameters != null)
{
foreach (var kv in newResetParameters.FloatParameters)
{
resetParameters[kv.Key] = kv.Value;
}
}
UpdateResetParameters();
SetIsInference(!brainBatcher.GetIsTraining());

}
else if (!firstAcademyReset)
{
UpdateResetParameters();
ForcedFullReset();
}

正在加载...
取消
保存