Observation norm for RL problems with early stopping via Welford's parallel algorithm#98
Open
keraJLi wants to merge 3 commits intoRobertTLange:mainfrom
Open
Observation norm for RL problems with early stopping via Welford's parallel algorithm#98keraJLi wants to merge 3 commits intoRobertTLange:mainfrom
keraJLi wants to merge 3 commits intoRobertTLange:mainfrom
Conversation
Author
|
Before this is merged, we should update the RL example notebook to handle the missing rollout states for brax. |
Author
|
I have updated the notebook, which now explicitly rolls out the search distribution mean. This did not create any notable extra complexity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses #97, which was prematurely closed by @maxencefaldor.
Switched to Welford's parallel algorithm for combining statistics collected during policy rollouts with global observation normalization statistics. This way, we don't have to go up to the maximum number of episode steps for every rollout, which can be super expensive.
This does not increase implementation complexity:
So +6 lines total, even though my code is very verbose.
I have tested both GymnaxProblem and BraxProblem by running ES training and calculating the statistics of the normalized rewards.
Caveat: we don't return all env states of the complete rollout. Doing this might be nice for visualization, but then we would also have to return state validity and mask out invalid states, which is not currently implemented and might easily be forgotten by users of the library. I suggest rolling out policies again for visualization, which is orders of magnitude cheaper than running a single generation.