This repository was archived by the owner on Nov 17, 2023. It is now read-only.
option to not reset eval metric with Speedometer#5827
Merged
piiswrong merged 11 commits intoapache:masterfrom Apr 24, 2017
Merged
option to not reset eval metric with Speedometer#5827piiswrong merged 11 commits intoapache:masterfrom
piiswrong merged 11 commits intoapache:masterfrom
Conversation
Closed
Contributor
Author
|
Could someone have a look to this pull request? It is addressing issue #5767 |
Contributor
|
The problem with this is printed training acc will lag behind current acc because it's averaging over the low accs in the beginning of the epoch. You also will see jumps in acc in the beginning of every epoch, which can be confusing |
Contributor
Author
|
True but dont you think printing NAN is more confusing? Maybe we could let this option but set it to false by default? |
Contributor
|
we can try to figure out a better way later. For now could you change default to auto_reset=True so that default behavior is not changed. |
Contributor
|
one way is to remove the reset from speedometer and put it in module.fit |
Contributor
Author
|
I have set auto_reset=True as you suggested. |
Guneet-Dhillon
pushed a commit
to Guneet-Dhillon/mxnet
that referenced
this pull request
Sep 13, 2017
* option to not reset eval metric with Speedometer * update contributors * cancel change to mshadow * reset metric by default
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Speedometer reset metrics which invalidates callbacks coming after them.
For instance
mod.fit(
train_data=train_iter,
eval_data=test_iter,
eval_metric=[mx.metric.CrossEntropy(), 'acc'],
batch_end_callback=[mx.callback.Speedometer(batch_size, 1), mx.callback.log_train_metric(1)]
)
gives the following log
INFO:root:Epoch[0] Batch [1] Speed: 311.33 samples/sec Train-cross-entropy=5.322994
INFO:root:Epoch[0] Batch [1] Speed: 311.33 samples/sec Train-accuracy=0.015625
INFO:root:Iter[0] Batch[1] Train-cross-entropy=nan
INFO:root:Iter[0] Batch[1] Train-accuracy=nan
I have set the default reset option of Speedometer to False to have the same default behavior as the other callback log_train_metric (also because it is unexpected for the user to have a default that has a side effect on the metric).