MCPcopy
hub / github.com/tensorlayer/TensorLayer / save

Method save

examples/reinforcement_learning/tutorial_DDPG.py:211–222  ·  view source on GitHub ↗

save trained weights :return: None

(self)

Source from the content-addressed store, hash-verified

209 self.pointer += 1
210
211 def save(self):
212 """
213 save trained weights
214 :return: None
215 """
216 path = os.path.join('model', '_'.join([ALG_NAME, ENV_ID]))
217 if not os.path.exists(path):
218 os.makedirs(path)
219 tl.files.save_weights_to_hdf5(os.path.join(path, 'actor.hdf5'), self.actor)
220 tl.files.save_weights_to_hdf5(os.path.join(path, 'actor_target.hdf5'), self.actor_target)
221 tl.files.save_weights_to_hdf5(os.path.join(path, 'critic.hdf5'), self.critic)
222 tl.files.save_weights_to_hdf5(os.path.join(path, 'critic_target.hdf5'), self.critic_target)
223
224 def load(self):
225 """

Callers 1

tutorial_DDPG.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected