浏览代码

Clean up env logging on initialization (#2950)

/develop-newnormalization
GitHub 5 年前
当前提交
e2eef3c4
共有 3 个文件被更改,包括 17 次插入25 次删除
  1. 5
      docs/Basic-Guide.md
  2. 7
      docs/Learning-Environment-Executable.md
  3. 30
      ml-agents-envs/mlagents/envs/environment.py

5
docs/Basic-Guide.md


INFO:mlagents.envs:
'Ball3DAcademy' started successfully!
Unity Academy name: Ball3DAcademy
Number of Brains: 1
Number of Training Brains : 1
Reset Parameters :
Reset Parameters : {}
INFO:mlagents.envs:Connected new brain:
Unity brain name: 3DBallLearning
Number of Visual Observations (per agent): 0
Vector Observation space size (per agent): 8

7
docs/Learning-Environment-Executable.md


Mono config path = '/Users/dericp/workspace/ml-agents/3DBall.app/Contents/MonoBleedingEdge/etc'
INFO:mlagents.envs:
'Ball3DAcademy' started successfully!
INFO:mlagents.envs:
'Ball3DAcademy' started successfully!
Number of Brains: 1
Number of Training Brains : 1
Reset Parameters :
Reset Parameters : {}
INFO:mlagents.envs:Connected new brain:
Unity brain name: Ball3DLearning
Number of Visual Observations (per agent): 0
Vector Observation space size (per agent): 8

30
ml-agents-envs/mlagents/envs/environment.py


)
def __str__(self):
return (
"""Unity Academy name: {0}
Number of Training Brains : {1}
Reset Parameters :\n\t\t{2}""".format(
self._academy_name,
str(self._num_external_brains),
"\n\t\t".join(
[
str(k) + " -> " + str(self._resetParameters[k])
for k in self._resetParameters
]
),
reset_params_str = (
"\n\t\t".join(
[
str(k) + " -> " + str(self._resetParameters[k])
for k in self._resetParameters
]
+ "\n"
+ "\n".join([str(self._brains[b]) for b in self._brains])
if self._resetParameters
else "{}"
return f"""Unity Academy name: {self._academy_name}
Reset Parameters : {reset_params_str}"""
def reset(
self,

agent_infos = output.rl_output.agentInfos[brain_param.brain_name]
if agent_infos.value:
agent = agent_infos.value[0]
self._brains[brain_param.brain_name] = BrainParameters.from_proto(
brain_param, agent
)
new_brain = BrainParameters.from_proto(brain_param, agent)
self._brains[brain_param.brain_name] = new_brain
logger.info(f"Connected new brain:\n{new_brain}")
self._external_brain_names = list(self._brains.keys())
self._num_external_brains = len(self._external_brain_names)

正在加载...
取消
保存