Skip to content

Commit

Permalink
Fixed incorrect actor_loss shape for SAC continuous, addresses issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
dosssman committed Oct 4, 2023
1 parent 7e24ae2 commit 0fceeef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cleanrl/sac_continuous_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def get_action(self, x):
pi, log_pi, _ = actor.get_action(data.observations)
qf1_pi = qf1(data.observations, pi)
qf2_pi = qf2(data.observations, pi)
min_qf_pi = torch.min(qf1_pi, qf2_pi).view(-1)
min_qf_pi = torch.min(qf1_pi, qf2_pi)
actor_loss = ((alpha * log_pi) - min_qf_pi).mean()

actor_optimizer.zero_grad()
Expand Down

1 comment on commit 0fceeef

@vercel
Copy link

@vercel vercel bot commented on 0fceeef Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cleanrl – ./

cleanrl-git-master-vwxyzjn.vercel.app
docs.cleanrl.dev
cleanrl-vwxyzjn.vercel.app
cleanrl.vercel.app

Please sign in to comment.