-
Notifications
You must be signed in to change notification settings - Fork 309
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
Refactor NPO #1189
Refactor NPO #1189
Conversation
src/garage/misc/tensor_utils.py
Outdated
|
||
Returns: | ||
numpy.ndarray: Stacked and padded tensor. Shape: :math:`(N, D, S^*)` | ||
where K is the len of input paths. |
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.
K?
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.
it's a typo, fixed
Can you describe in your commit message/subject in a little more detail what and why you are refactoring NPO? |
Done |
Codecov Report
@@ Coverage Diff @@
## master #1189 +/- ##
==========================================
- Coverage 87.99% 87.97% -0.02%
==========================================
Files 184 184
Lines 8771 8776 +5
Branches 1108 1111 +3
==========================================
+ Hits 7718 7721 +3
- Misses 854 855 +1
- Partials 199 200 +1
Continue to review full report at Codecov.
|
be4f360
to
8417901
Compare
src/garage/misc/tensor_utils.py
Outdated
@@ -23,20 +23,26 @@ def discount_cumsum(x, discount): | |||
axis=0)[::-1] | |||
|
|||
|
|||
def explained_variance_1d(ypred, y): | |||
def explained_variance_1d(ypred, y, valids): |
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.
hmm perhaps valids should be optional?
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.
Yea
9a275f4
to
4c4ec69
Compare
# pylint: disable=abstract-class-instantiated, no-member | ||
# This test cause low memory with some reason | ||
@pytest.mark.flaky |
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.
that would be really surprising. you seen this in the wild on master?
It seems likely that some other part of the test suite is using all if your memory, and this test just became a victim.
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.
that makes sense, I will remove the decorator
* Rename fit_baseline to fit_baseline_with_data to avoid naming conflicts with argument names in RL2NPO * Unify returns and rewards in sample_data to dense form
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.
One minor question, but LGTM.
This PR refactors NPO, as discussed in #1172 , in preparation of RL2NPO.