Exponential Moving Average of Weights (EMA) #138
Closed
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.
EMA as used in "Fast and Accurate Model Scaling" to improve accuracy.
Note that EMA of model weights is nearly free computationally (if not
computed every iter), hence EMA weights area always computed/stored.
Saving/loading checkpoints has been updated, but the code is backward
compatible with checkpoints that do not store the ema weights.
Details:
-config.py: added EMA options
-meters.py: generalized to allow for ema meter
-net.py: added update_model_ema() to compute model ema
-trainer.py: added updating/testing/logging of ema model
-checkpoint.py: save/load_checkpoint() also save/load ema weights