浏览代码

Merge pull request #1045 from Unity-Technologies/develop-unityagents-nan-reward

Nan Rewards converted to 0 and throwing a warning
/develop-generalizationTraining-TrainerController
GitHub 6 年前
当前提交
5efa9d4e
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 5
      python/unityagents/environment.py

5
python/unityagents/environment.py


import glob
import io
import logging
import math
import numpy as np
import os
import subprocess

else:
[x.memories.extend([0] * (memory_size - len(x.memories))) for x in agent_info_list]
memory = np.array([x.memories for x in agent_info_list])
if any([math.isnan(x.reward) for x in agent_info_list]):
logger.warning("An agent had a NaN reward for brain "+b)
reward=[x.reward for x in agent_info_list],
reward=[x.reward if not math.isnan(x.reward) else 0 for x in agent_info_list],
agents=[x.id for x in agent_info_list],
local_done=[x.done for x in agent_info_list],
vector_action=np.array([x.stored_vector_actions for x in agent_info_list]),

正在加载...
取消
保存