Commit 32cef6a4 authored by Nicola Gatto's avatar Nicola Gatto
Browse files

Use mean when calculating actor loss

parent 5d9ba4fa
Pipeline #153276 failed with stages
in 2 minutes and 1 second
...@@ -548,7 +548,7 @@ class DdpgAgent(Agent): ...@@ -548,7 +548,7 @@ class DdpgAgent(Agent):
actor_qvalues = tmp_critic(states, self._actor(states)) actor_qvalues = tmp_critic(states, self._actor(states))
# For maximizing qvalues we have to multiply with -1 # For maximizing qvalues we have to multiply with -1
# as we use a minimizer # as we use a minimizer
actor_loss = -1 * actor_qvalues actor_loss = -1 * actor_qvalues.mean()
actor_loss.backward() actor_loss.backward()
trainer_actor.step(self._minibatch_size) trainer_actor.step(self._minibatch_size)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment