浏览代码

Add add_policy docstrings

/develop/nopreviousactions
Ervin Teng 5 年前
当前提交
88998fc9
共有 2 个文件被更改,包括 8 次插入1 次删除
  1. 6
      ml-agents/mlagents/trainers/ghost/trainer.py
  2. 3
      ml-agents/mlagents/trainers/ppo/trainer.py

6
ml-agents/mlagents/trainers/ghost/trainer.py


return self.trainer.create_policy(brain_parameters)
def add_policy(self, name_behavior_id: str, policy: TFPolicy) -> None:
"""
Adds policy to trainer. For the first policy added, add a trainer
to the policy and set the learning behavior name to name_behavior_id.
:param name_behavior_id: Behavior ID that the policy should belong to.
:param policy: Policy to associate with name_behavior_id.
"""
self.policies[name_behavior_id] = policy
policy.create_tf_graph()

3
ml-agents/mlagents/trainers/ppo/trainer.py


def add_policy(self, name_behavior_id: str, policy: TFPolicy) -> None:
"""
Adds policy to trainer.
:param brain_parameters: specifications for policy construction
:param name_behavior_id: Behavior ID that the policy should belong to.
:param policy: Policy to associate with name_behavior_id.
"""
if self.policy:
logger.warning(

正在加载...
取消
保存