Skip to content
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

fix incomplete RunningMean #1309

Merged
merged 7 commits into from
Mar 30, 2020
Merged

fix incomplete RunningMean #1309

merged 7 commits into from
Mar 30, 2020

Conversation

Borda
Copy link
Member

@Borda Borda commented Mar 30, 2020

What does this PR do?

Until the mean is once rotated it returns random numbers.

t = torch.Tensor(5)
Out[5]: tensor([3.8516e-37, 0.0000e+00, 1.6114e-19, 1.8475e+31, 3.8715e-37])
t[0] = 1
Out[7]: tensor([1.0000e+00, 0.0000e+00, 1.6114e-19, 1.8475e+31, 3.8715e-37])
t.mean()
Out[8]: tensor(3.6949e+30)

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?

Make sure you had fun coding 🙃

@Borda Borda added bug Something isn't working priority: 0 High priority task labels Mar 30, 2020
@Borda Borda added this to the 0.7.2 milestone Mar 30, 2020
@Borda Borda changed the title fix incoRunningMean fix incomplete RunningMean Mar 30, 2020
Borda and others added 2 commits March 30, 2020 22:47
just needed to multiply by zero for init
@Borda
Copy link
Member Author

Borda commented Mar 30, 2020

@williamFalcon why you changed it to return self.memory.mean()?
if you have [0, 0, 0, 0, 0] and place single value 1, then you get 0.2 as mean instead of 1

@pep8speaks
Copy link

pep8speaks commented Mar 30, 2020

Hello @Borda! Thanks for updating this PR.

Line 1529:111: E501 line too long (111 > 110 characters)

Comment last updated at 2020-03-30 21:34:42 UTC

@Borda Borda marked this pull request as ready for review March 30, 2020 21:27
@Borda Borda requested a review from a team March 30, 2020 21:27
@Borda Borda added the ready PRs ready to be merged label Mar 30, 2020
@williamFalcon williamFalcon merged commit 3101712 into master Mar 30, 2020
@Borda Borda deleted the fix-RunningMean branch March 30, 2020 22:30
alexeykarnachev pushed a commit to alexeykarnachev/pytorch-lightning that referenced this pull request Apr 3, 2020
* fix RunningMean

* changelog

* fix none

* Update supporters.py

just needed to multiply by zero for init

* Revert "Update supporters.py"

This reverts commit 7e0da6c

* fix NaN

* formatting

Co-authored-by: William Falcon <waf2107@columbia.edu>
@Borda Borda modified the milestones: v0.7., v0.7.x Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: 0 High priority task ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants