浏览代码

[skip ci] fixing property decorator in sac

/release_3_distributed
Anupam Bhatnagar 4 年前
当前提交
392a84f1
共有 3 个文件被更改,包括 3 次插入10 次删除
  1. 8
      ml-agents/mlagents/trainers/ppo/trainer.py
  2. 3
      ml-agents/mlagents/trainers/sac/trainer.py
  3. 2
      ml-agents/mlagents/trainers/trainer/rl_trainer.py

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


self.seed = seed
self.policy: NNPolicy = None # type: ignore
def should_still_train(self) -> bool:
"""
Returns whether or not the trainer should train. A Trainer could
stop training if it wasn't training to begin with, or if max_steps
is reached.
"""
return self.is_training and self.get_step <= self.trainer_settings.max_steps
def _process_trajectory(self, trajectory: Trajectory) -> None:
"""
Takes a trajectory and processes it, putting it into the update buffer.

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


)
)
@property
def should_still_train(self) -> bool:
"""
Returns whether or not the trainer should train. A Trainer could

return self.is_training and self.steps_per_update * self.update_steps <= \
self.trainer_settings.max_steps
self.get_max_steps
def _process_trajectory(self, trajectory: Trajectory) -> None:
"""

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


"""
Saves training statistics to Tensorboard.
"""
self.stats_reporter.add_stat("Is Training", float(self.should_still_train()))
self.stats_reporter.add_stat("Is Training", float(self.should_still_train))
self.stats_reporter.write_stats(int(step))
@abc.abstractmethod

正在加载...
取消
保存