Skip to content

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

Merged
merged 5 commits into from
May 13, 2017
Merged

change convergence callback #2098

merged 5 commits into from
May 13, 2017

Conversation

ferrine
Copy link
Member

@ferrine ferrine commented May 1, 2017

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.

@twiecki
Copy link
Member

twiecki commented May 1, 2017

Hm, not sure what consequences this would have in other scenarios. Have you tried this on different models and found it to work robustly?
CC @aseyboldt.

@ferrine
Copy link
Member Author

ferrine commented May 1, 2017

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.

@ferrine
Copy link
Member Author

ferrine commented May 1, 2017

I'm testing this callback while refactoring notebooks in #2097

@aseyboldt
Copy link
Member

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.
@ferrine Did you try a model with very different posterior variances? Maybe something like Bayesian lasso, where the number of parameters grows linearly with the dataset size.

@ferrine
Copy link
Member Author

ferrine commented May 2, 2017

I have not tried rescaling. That's a big field for experiments.

@ferrine
Copy link
Member Author

ferrine commented May 12, 2017

I have little time for experiments, what about adding kwarg for specifying what norm to use?

@twiecki
Copy link
Member

twiecki commented May 12, 2017

@ferrine I like that.

@twiecki
Copy link
Member

twiecki commented May 12, 2017

Tthis could really use a simple test.

tolerance : float
if diff norm < tolerance : break
diff : str
difference type one of {'absolute', 'percentage'}
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point

@ferrine ferrine merged commit 22d5ecd into pymc-devs:master May 13, 2017
@ferrine ferrine deleted the convergence_callback branch May 13, 2017 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants