From c8b987a7f3a787dea5502db0516ee23b01697a90 Mon Sep 17 00:00:00 2001 From: Pranjal Tandon Date: Fri, 21 Sep 2018 00:36:21 +0530 Subject: [PATCH] Update sac.py --- sac.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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):