Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix RMSProp update rule #6235

Merged
merged 6 commits into from
May 13, 2017
Merged

Fix RMSProp update rule #6235

merged 6 commits into from
May 13, 2017

Conversation

sifmelcara
Copy link
Contributor

When using Alex's version of RMSProp to train a network, I found it sometimes update some network weights to NaN.
After that, I found the RMSProp implementation is a little bit different from Alex's paper. In equation 40, the epsilon should be under the square root.

I guess I got NaN because state_n - state_g * state_g can sometimes be something like -1e-20 (because of floating point arithmetic error). Indeed, after I applied this patch, it stops update network weights to NaN.

sifmelcara and others added 4 commits May 13, 2017 21:13
Follow the formula presents in Alex's paper,
this prevents taking square root of a negative
value (caused by arithmetic error).
@piiswrong
Copy link
Contributor

piiswrong commented May 13, 2017

You need to fix the tests in tests/python/unittests/test_optimizer too

@sifmelcara
Copy link
Contributor Author

Although I do not know how to write Perl, I also updated the test in perl module. (Hope it will pass)

@sergeykolychev
Copy link
Contributor

@sifmelcara thank you for updating perl test.

@piiswrong piiswrong merged commit 38f7c55 into apache:master May 13, 2017
saurabh3949 pushed a commit to saurabh3949/mxnet that referenced this pull request May 23, 2017
* Fix RMSProp update rule

Follow the formula presents in Alex's paper,
this prevents taking square root of a negative
value (caused by arithmetic error).

* Fix the formula of non centered version of RMSProp

* Fix RMSProp update rule in python test

* Fix RMSProp update rule in perl test
Guneet-Dhillon pushed a commit to Guneet-Dhillon/mxnet that referenced this pull request Sep 13, 2017
* Fix RMSProp update rule

Follow the formula presents in Alex's paper,
this prevents taking square root of a negative
value (caused by arithmetic error).

* Fix the formula of non centered version of RMSProp

* Fix RMSProp update rule in python test

* Fix RMSProp update rule in perl test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants