save trained weights :return: None
(self)
| 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 | """ |