浏览代码

[Imitation Learning] Minor fix to make sure that step increment loads from the last saved global step if the model is being trained after loading

/develop-generalizationTraining-TrainerController
eshvk 7 年前
当前提交
680b0767
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 5
      python/unitytrainers/bc/trainer.py

5
python/unitytrainers/bc/trainer.py


self.brain_to_imitate = trainer_parameters['brain_to_imitate']
self.batches_per_epoch = trainer_parameters['batches_per_epoch']
self.use_recurrent = trainer_parameters['use_recurrent']
self.step = 0
self.sequence_length = 1
self.m_size = None
if self.use_recurrent:

Returns the number of steps the trainer has performed
:return: the step count of the trainer
"""
return self.step
return self.sess.run(self.model.global_step)
@property
def get_last_reward(self):

"""
Increment the step count of the trainer
"""
self.step += 1
self.sess.run(self.model.increment_step)
def update_last_reward(self):
"""

正在加载...
取消
保存