-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
change convergence callback #2098
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
Conversation
Hm, not sure what consequences this would have in other scenarios. Have you tried this on different models and found it to work robustly? |
I found that I was able to catch convergence in Exploding SVGD experiments using this callback. As a remark I was experimenting on this example. It did well with little tuning. |
I'm testing this callback while refactoring notebooks in #2097 |
The previous version using the relative change made sure the stopping criterion doesn't change if we rescale variables, the new version using absolute change is invariant if we add constants (or something like that. It's not quite so simple, as the optimization algorithm probably behaves differently if we change the parametrization). Intuitively I'd guess that looking at the relative change should work better – just because rescaling is such a natural thing to get the posteriors variances similar. But I don't know a good argument either way. |
I have not tried rescaling. That's a big field for experiments. |
I have little time for experiments, what about adding kwarg for specifying what norm to use? |
@ferrine I like that. |
Tthis could really use a simple test. |
pymc3/variational/callbacks.py
Outdated
tolerance : float | ||
if diff norm < tolerance : break | ||
diff : str | ||
difference type one of {'absolute', 'percentage'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be called relative
instead of "percentage"? Its not multiplied by 0.01. Also, I can't remember seeing that specified as a percentage before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
(cherry picked from commit a7ecea7)
Since neither convergence check work properly, this one seems to be reasonable enough.
Remark. This PR changes percentage absolute norm change with simple absolute norm change. As for small values percentage change is very noisy.