Skip to content

Commit

Permalink
Log rewards statistics in SAC agents
Browse files Browse the repository at this point in the history
(similar to PPO agents)
  • Loading branch information
wookayin committed May 23, 2022
1 parent 71b2ab8 commit 5e38355
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions acme/agents/jax/sac/learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ def update_step(
jax.tree_map(lambda x: jnp.std(x, axis=0),
transitions.next_observation)))

metrics['rewards_mean'] = jnp.mean(
jnp.abs(jnp.mean(transitions.reward, axis=0)))
metrics['rewards_std'] = jnp.std(transitions.reward, axis=0)

return new_state, metrics

# General learner book-keeping and loggers.
Expand Down

0 comments on commit 5e38355

Please sign in to comment.