Make Average Model support for 'moving mean' and 'moving variance' of batch_normal op#9459
Merged
wanghaoshuang merged 8 commits intoPaddlePaddle:developfrom Apr 12, 2018
Merged
Conversation
1. Add attr 'average' into ParamAttr. 2. Make 'params_grads' optional for AverageModel. 3. Add option 'average_mean' and 'average_variance' for batch_normal.
qingqing01
reviewed
Apr 3, 2018
python/paddle/fluid/layers/nn.py
Outdated
| moving_variance_name=None): | ||
| moving_variance_name=None, | ||
| average_mean=True, | ||
| average_variance=True): |
Contributor
There was a problem hiding this comment.
- default by False
- average_mean, average_variance -> do_model_average_for_mean_and_var?
They can share the same flag.
python/paddle/fluid/framework.py
Outdated
|
|
||
| self.gradient_clip_attr = kwargs.get('gradient_clip_attr', None) | ||
|
|
||
| self.average = kwargs.get('average', True) |
Contributor
There was a problem hiding this comment.
average -> do_model_ average ?
The meaning of average is not clear.
python/paddle/fluid/optimizer.py
Outdated
| def __init__(self, | ||
| params_grads, | ||
| average_window_rate, | ||
| average_window_rate=0.15, |
Contributor
There was a problem hiding this comment.
Do not set 0.15 as a default value. 0.15 is not general rate.
python/paddle/fluid/param_attr.py
Outdated
| trainable=True, | ||
| gradient_clip=None): | ||
| gradient_clip=None, | ||
| average=True): |
Contributor
There was a problem hiding this comment.
avera=True -> do_model_ average=None.
python/paddle/fluid/param_attr.py
Outdated
| self.regularizer = regularizer | ||
| self.trainable = trainable | ||
| self.gradient_clip = gradient_clip | ||
| self.average = average |
Contributor
There was a problem hiding this comment.
average -> model_average
qingqing01
approved these changes
Apr 12, 2018
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.
fix #9458