Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding stop threshold logic #3863

Merged
merged 6 commits into from
Apr 10, 2018
Merged

Adding stop threshold logic #3863

merged 6 commits into from
Apr 10, 2018

Conversation

karmel
Copy link
Contributor

@karmel karmel commented Apr 3, 2018

We want to be able to stop training at a specified accuracy or other model-specific metric. Helper function added here, along with run loop logic for existing models.

@qlzh727 -- when running time-to-converge tests, we will likely want to run with the flag --stop_threshold=

@yhliang2018 -- when adding new models, they should include stopping logic in the run loop.

@karmel karmel requested review from k-w-w and nealwu as code owners April 3, 2018 22:26
@karmel karmel removed the request for review from nealwu April 3, 2018 22:26
Copy link
Member

@qlzh727 qlzh727 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am bit worried about the behavior here since the threshold is not necessary monotonic increasing/decreasing. We might just quit early when the model is in a locally optimized situation.

I think we should consider "How long it has been above the threshold" if possible. @petermattson for more inputs.

import tensorflow as tf


def past_stop_threshold(stop_threshold, eval_metric):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, probably should have a similar function which stop when a metric is smaller that the threshold.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty simple to add a flag in theory, but in practice, I don't know that we have a use-case yet for a lower-is-better metric. @petermattson , is any target metric decreasing?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For performance purposes, crossing the line is acceptable, since all the benchmark implementations play by the same rules. The only question is timing instability, and we're addressing that through multiple runs. We can revisit if that's insufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That addresses the question of monotonicity; do you also anticipate needing to handle decreasing metrics (ie, the model is better if the metric is lower), or just increasing metrics for now?

Copy link

@petermattson petermattson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!
(Assume there is another PR for Transformer.)

@karmel
Copy link
Contributor Author

karmel commented Apr 5, 2018

@petermattson -- there are a couple questions for you in the comments; can you address?

@petermattson
Copy link

petermattson commented Apr 9, 2018 via email

@karmel
Copy link
Contributor Author

karmel commented Apr 10, 2018

Pushing this now, and then will copy over manually to add build files.

@karmel karmel merged commit 310f70d into master Apr 10, 2018
@petermattson
Copy link

petermattson commented Apr 10, 2018 via email

omegafragger pushed a commit to omegafragger/models that referenced this pull request May 15, 2018
* Adding tests

* Adding tests

* Repackaging

* Adding logging

* Linting
@tfboyd tfboyd deleted the feat/acc_thresh branch February 7, 2019 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants