diff --git a/sac.py b/sac.py index 9309808..96b7de3 100644 --- a/sac.py +++ b/sac.py @@ -151,10 +151,12 @@ class SAC(object): We update the target weights to match the current value function weights periodically Update target parameter after every n(args.value_update) updates """ - if updates % self.target_update_interval == 0 and self.deterministic == True: + if updates % self.value_update == 0 and self.deterministic == True: soft_update(self.critic_target, self.critic, self.tau) - elif updates % self.target_update_interval == 0 and self.deterministic == False: + return 0, q1_value_loss.item(), q2_value_loss.item(), policy_loss.item() + elif updates % self.value_update == 0 and self.deterministic == False: soft_update(self.value_target, self.value, self.tau) + return value_loss.item(), q1_value_loss.item(), q2_value_loss.item(), policy_loss.item() # Save model parameters def save_model(self, env_name, suffix="", actor_path=None, critic_path=None, value_path=None):