-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
[RLlib] Add addtional_update to RL Trainer #31541
[RLlib] Add addtional_update to RL Trainer #31541
Conversation
Signed-off-by: Avnish <avnishnarayan@gmail.com>
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.
Quick comment.
rllib/core/rl_trainer/rl_trainer.py
Outdated
@@ -205,6 +205,14 @@ def update(self, batch: MultiAgentBatch) -> Mapping[str, Any]: | |||
self.do_distributed_update(batch) | |||
return self.compile_results(batch, fwd_out, loss, post_processed_gradients) | |||
|
|||
def additional_update(self) -> Mapping[str, Any]: |
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.
should it not take in any parameters? like *args, **kwargs? what should be returned? also provide some more context on where this would get called?
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.
fair enough, I thought there wasn't a point to adding args kwargs here because users can just do whatever they want
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.
then it should be *args, **kwargs to make it explicit. But the returned value should have some explaination.
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.
done
Signed-off-by: Avnish <avnishnarayan@gmail.com>
Signed-off-by: Avnish <avnishnarayan@gmail.com>
Signed-off-by: Avnish avnishnarayan@gmail.com
Add the additional updates function to the RL-Trainer.
For example, it could be used to do a polyak averaging update
of a target network in off policy algorithms like SAC or DQN.
Why are these changes needed?
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.