-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: term vs trunc #983
base: develop
Are you sure you want to change the base?
fix: term vs trunc #983
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sash-a! I will continue the review once we verify the recurrent systems performance :)
trunc = jnp.repeat(timestep.last(), config.system.num_agents) | ||
trunc = trunc.reshape(config.arch.num_envs, -1) | ||
term = 1 - timestep.discount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can add documentation to timestep.last()
and timestep.discount
info = { | ||
"episode_return": env_state.episode_return_info, | ||
"episode_length": env_state.episode_length_info, | ||
} | ||
|
||
transition = PPOTransition( | ||
done, action, value, timestep.reward, log_prob, last_timestep.observation, info | ||
terminal=term, | ||
truncated=trunc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random question, why do we include truncation if we don't use it 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the changes of removing last_done
from the learner_state
hstates, | ||
) = learner_state | ||
|
||
rng, policy_rng = jax.random.split(rng) | ||
|
||
last_trunc = jnp.repeat(last_timestep.last(), n_agents).reshape(n_envs, -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you can add documentation # Add last_trunc to the input to the network.
Note
This is quite confusing so please check this carefully and make sure I haven't mixed up where to use each one!
What?
Mostly explained in #951. We are mixing up termination and truncation. This is especially prevalent in recurrent systems, but all systems have this issue.
Now very explicit about termination vs truncation, removed all mentions of done.
Done attribute remove from
RnnLearnerState
and replaced withtruncated
in thePpoTransition
.How?
Explicitly name variables
termination
andtrunctation
instead ofdone