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

Method save

examples/reinforcement_learning/tutorial_PPO.py:204–213  ·  view source on GitHub ↗

save trained weights :return: None

(self)

Source from the content-addressed store, hash-verified

202 return np.clip(action, -self.action_bound, self.action_bound)
203
204 def save(self):
205 """
206 save trained weights
207 :return: None
208 """
209 path = os.path.join('model', '_'.join([ALG_NAME, ENV_ID]))
210 if not os.path.exists(path):
211 os.makedirs(path)
212 tl.files.save_weights_to_hdf5(os.path.join(path, 'actor.hdf5'), self.actor)
213 tl.files.save_weights_to_hdf5(os.path.join(path, 'critic.hdf5'), self.critic)
214
215 def load(self):
216 """

Callers 2

tutorial_PPO.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected