save trained weights :return: None
(self)
| 329 | return tf.group([p.assign(p_new) for p, p_new in zip(pi_params, new_params)]) |
| 330 | |
| 331 | def save(self): |
| 332 | """ |
| 333 | save trained weights |
| 334 | :return: None |
| 335 | """ |
| 336 | path = os.path.join('model', '_'.join([ALG_NAME, ENV_ID])) |
| 337 | if not os.path.exists(path): |
| 338 | os.makedirs(path) |
| 339 | tl.files.save_weights_to_hdf5(os.path.join(path, 'actor.hdf5'), self.actor) |
| 340 | tl.files.save_weights_to_hdf5(os.path.join(path, 'critic.hdf5'), self.critic) |
| 341 | |
| 342 | def load(self): |
| 343 | """ |