[new] Add the YellowFin optimizer (YFOptimizer)#130
Open
ruizewang wants to merge 1 commit intofastnlp:masterfrom
Open
[new] Add the YellowFin optimizer (YFOptimizer)#130ruizewang wants to merge 1 commit intofastnlp:masterfrom
ruizewang wants to merge 1 commit intofastnlp:masterfrom
Conversation
Add the YellowFin optimizer,called YFOptimizer. YellowFin is an auto-tuning optimizer based on momentum SGD which requires no manual specification of learning rate and momentum. It measures the objective landscape on-the-fly and tunes momentum as well as learning rate using a local quadratic approximation. paper: https://arxiv.org/abs/1706.03471 code: https://github.com/JianGoForIt/YellowFin_Pytorch
Codecov Report
@@ Coverage Diff @@
## master #130 +/- ##
==========================================
- Coverage 68% 65.99% -2.02%
==========================================
Files 90 90
Lines 6286 6517 +231
==========================================
+ Hits 4275 4301 +26
- Misses 2011 2216 +205
Continue to review full report at Codecov.
|
FengZiYjun
approved these changes
Feb 10, 2019
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.
Description:
Add the YellowFin optimizer,called YFOptimizer.
YellowFin is an auto-tuning optimizer based on momentum SGD which requires no manual specification of learning rate and momentum. It measures the objective landscape on-the-fly and tunes momentum as well as learning rate using a local quadratic approximation.
We can use YFOptimizer just like Adam and SGD.
For example:
from fastNLP.core.optimizer import YFOptimizertrainer = Trainer(model=model, n_epochs=100, optimizer=YFOptimizer(lr=0.01), train_data=train_data, dev_data=dev_data, loss=CrossEntropyLoss(), metrics=AccuracyMetric() )paper: https://arxiv.org/abs/1706.03471
code: https://github.com/JianGoForIt/YellowFin_Pytorch
Main reason: Add a fancy optimizer, which performs well in many tasks, though has its shortcomings. The biggest advantage is that you can use the default parameters directly, no need to adjust LR manually. (Note: there are also some people say they get a bad performance.)
Checklist 检查下面各项是否完成
Please feel free to remove inapplicable items for your PR.
Changes: 逐项描述修改的内容
Mention: 找人review你的PR
@修改过这个文件的人
@核心开发人员