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.
What does this PR do?
Hello! As discussed in issue 596 together with @NaIwo we implemented the TRPO method in the RL module.
Implementation & Results
In order to validate the implementation and prove correctness, our code was quite heavily based on an implementation from the Implementation Matters in Deep Policy Gradients: A Case Study on PPO and TRPO publication by Logan Engstrom et al. with source code in Github.
We tested our code on environments from the publication (Walker, Hopper and Humanoid from MuJoCo, all are continuous),
and one simple discrete, just to verify the correctness of the implementation - LunarLander.
Of course, our implementations differ in several ways - we set the direction of improvement based on the whole batch
rather than 10%, different actor and critic architectures, training in a multi/single agent framework etc.
The point here is not to reproduce the results exactly, but simply to show that our implementation meets the expected minimum ;)
The scores presented by the authors are aggregated as expected returns based on agent performance after 500 learning epochs.
We simply show the average of the last 100 episodes after epochs execution (typically one epoch has significantly fewer
episodes 2-10 depending on the environment).
Humanoid
Expected: [576, 596]
Ours - without problem to obtain cumulated rewards around 600
Command to reproduce:
Hopper
Expected: [1948, 2136]
Ours - on the average the model works similarly
Command to reproduce:
Walker
Expected: [2709, 2873]
Ours - Our model performs worse, even with more experience, however, with tuned parameters it meets the expected threshold
Command to reproduce:
LunarLander
Expected - in short, a score around 200 indicates a correctly completed task
Ours - the agent was able to learn how to solve task
Command to reproduce:
You can see more plots in the link: wandb.
If you would like to run our code without installing MuJoCo you can use Colab, which we also used for a while ;)
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Absolutely!