-
Notifications
You must be signed in to change notification settings - Fork 0
GePPO #23
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
base: dev
Are you sure you want to change the base?
GePPO #23
Conversation
sheim
left a comment
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.
Overall looks good, I haven't checked in detail the GePPO implementation, is there something specific you want me to look at closely?
| activation="elu", | ||
| init_noise_std=1.0, | ||
| normalize_obs=True, | ||
| store_pik=False, |
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.
use readable variable names. What is "pik"?
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 think this would be easy enough to create a new actor class that inherits from the vanilla actor, what do you think?
learning/modules/utils/normalize.py
Outdated
| mean = input.mean(tuple(range(input.dim() - 1))) | ||
| var = input.var(tuple(range(input.dim() - 1))) | ||
| # TODO: check this, it got rid of NaN values in first iteration | ||
| dim = tuple(range(input.dim() - 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.
simpler, use torch.nan_to_num()
|
|
||
| # Implementation based on GePPO repo: https://github.com/jqueeney/geppo | ||
| @torch.no_grad | ||
| def compute_gae_vtrace(data, gamma, lam, is_trunc, actor, critic, rec=False): |
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.
rule of thumb, don't abbreviate (rec --> recursive)
| offpol_ratio = torch.exp(log_prob_pik - batch["log_prob"]) | ||
|
|
||
| advantages = batch["advantages"] | ||
| if self.normalize_advantages: |
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.
this is currently set to False, which surprises me, that seemed to be quite important in PPO...
| counter += 1 | ||
| self.mean_surrogate_loss /= counter | ||
|
|
||
| # Compute TV, add to self for logging |
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.
what is TV?
Issue ticket number and link
Fixes # (issue)
Describe your changes
Please include a summary of the change, including why you did this, and the desired effect.
Instructions for reviewers
Indicate anything in particular that you would like a code-reviewer to pay particular attention to.
Indicate steps to actually test code, including CLI instructions if different than usual.
Point out the desired behavior, and not just the "check that this appears" (otherwise the code reviewer will be lazy and just verify what you've already verified).
Checklist before requesting a review
ruff format .manually