Soft updating by exponential smoothing :return: None
(self)
| 139 | self.critic_opt = tf.optimizers.Adam(LR_C) |
| 140 | |
| 141 | def ema_update(self): |
| 142 | """ |
| 143 | Soft updating by exponential smoothing |
| 144 | :return: None |
| 145 | """ |
| 146 | paras = self.actor.trainable_weights + self.critic.trainable_weights |
| 147 | self.ema.apply(paras) |
| 148 | for i, j in zip(self.actor_target.trainable_weights + self.critic_target.trainable_weights, paras): |
| 149 | i.assign(self.ema.average(j)) |
| 150 | |
| 151 | def get_action(self, s, greedy=False): |
| 152 | """ |