adds more conservative PyMC3 sampling initialization defaults #57

merged 1 commit into from Jan 5, 2017


None yet

4 participants

tyarkoni commented Jan 5, 2017

In recent releases, PyMC3 defaults to using ADVI to find a sensible starting point for sampling. It also defaults to a rather large number of initialization iterations (200,000). While this no doubt ensures saner starting points, for the kind of models our users are likely to be fitting, the initial ADVI run is likely to add a non-negligible amount of computation (e.g., I just started fitting a model with ~80k rows and no very many parameters, and the estimated time just for advi to finish is nearly 2 hours!). Also, at least in the one case I tested, initializing with ADVI rather bizarrely appears to break the sampler, in that it causes NUTS to return crazy values (with virtually no variances in the traces) for most parameters.

Since all extra args and kwargs passed to are passed onto the sampler, the user can easily control this by setting init=None and/or n_init to a much smaller value. But since the point is to prevent our users from having to think about sampling details as much as possible, I suggest we explicitly set the default init to None and the default n_init to 10000. I've made changes accordingly.

@tyarkoni tyarkoni adds more conservative PyMC3 sampling initialization defaults
coveralls commented Jan 5, 2017 edited

Coverage Status

Coverage remained the same at 96.839% when pulling 4a21d1d on sampling-defaults into ddc19c8 on master.

@jake-westfall jake-westfall merged commit ddad70d into master Jan 5, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed
twiecki commented Jan 5, 2017

@tyarkoni That sounds like a pymc3 problem to me. @aloctavodia just found a problem with starting values: pymc-devs/pymc3#1645 Can you see if that changes something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment