浏览代码

Fix bug with construct_curr_info and test

/develop-gpu-test
Ervin Teng 5 年前
当前提交
e0da93d1
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 2
      ml-agents/mlagents/trainers/rl_trainer.py
  2. 4
      ml-agents/mlagents/trainers/tests/test_rl_trainer.py

2
ml-agents/mlagents/trainers/rl_trainer.py


:return: curr_info: Reconstructed BrainInfo to match agents of next_info.
"""
visual_observations: List[List[Any]] = [
[]
[] for _ in next_info.visual_observations
] # TODO add types to brain.py methods
vector_observations = []
text_observations = []

4
ml-agents/mlagents/trainers/tests/test_rl_trainer.py


# assert construct_curr_info worked properly
assert len(brain_info.agents) == 1
assert len(brain_info.visual_observations) == 1
assert len(brain_info.visual_observations[0]) == 1
assert len(brain_info.vector_observations) == 1
assert len(brain_info.previous_vector_actions) == 1
# Test end episode
trainer.end_episode()

正在加载...
取消
保存