PyMC v3.10.0 Release Notes

Release Date: 2020-12-07 // over 1 year ago
  • ๐Ÿš€ This is a major release with many exciting new features. The biggest change is that we now rely on our own fork of Theano-PyMC. This is in line with our big announcement about our commitment to PyMC3 and Theano.

    โฌ†๏ธ When upgrading, make sure that Theano-PyMC and not Theano are installed (the imports remain unchanged, however). If not, you can uninstall Theano:

    conda remove theano
    

    And to install:

    conda install -c conda-forge theano-pymc
    

    Or, if you are using pip (not recommended):

    pip uninstall theano
    

    And to install:

    pip install theano-pymc
    

    ๐Ÿ‘€ This new version of Theano-PyMC comes with an experimental JAX backend which, when combined with the new and experimental JAX samplers in PyMC3, can greatly speed up sampling in your model. As this is still very new, please do not use it in production yet but do test it out and let us know if anything breaks and what results you are seeing, especially speed-wise.

    ๐Ÿ†• New features

    • ๐Ÿ†• New experimental JAX samplers in pymc3.sample_jax (see notebook and #4247). Requires JAX and either TFP or numpyro.
    • โž• Add MLDA, a new stepper for multilevel sampling. MLDA can be used when a hierarchy of approximate posteriors of varying accuracy is available, offering improved sampling efficiency especially in high-dimensional problems and/or where gradients are not available (see #3926)
    • โž• Add Bayesian Additive Regression Trees (BARTs) #4183)
    • โž• Added pymc3.gp.cov.Circular kernel for Gaussian Processes on circular domains, e.g. the unit circle (see #4082).
    • โž• Added a new MixtureSameFamily distribution to handle mixtures of arbitrary dimensions in vectorized form for improved speed (see #4185).
    • sample_posterior_predictive_w can now feed on xarray.Dataset - e.g. from InferenceData.posterior. (see #4042)
    • ๐Ÿ”„ Change SMC metropolis kernel to independent metropolis kernel #4115)
    • โž• Add alternative parametrization to NegativeBinomial distribution in terms of n and p (see #4126)
    • โž• Added semantically meaningful str representations to PyMC3 objects for console, notebook, and GraphViz use (see #4076, #4065, #4159, #4217, #4243, and #4260).
    • โž• Add Discrete HyperGeometric Distribution (see #4249)

    ๐Ÿšง Maintenance

    • Switch the dependency of Theano to our own fork, Theano-PyMC.
    • โœ‚ Removed non-NDArray (Text, SQLite, HDF5) backends and associated tests.
    • ๐Ÿ Use dill to serialize user defined logp functions in DensityDist. The previous serialization code fails if it is used in notebooks on Windows and Mac. dill is now a required dependency. (see #3844).
    • ๐Ÿ›  Fixed numerical instability in ExGaussian's logp by preventing logpow from returning -inf (see #4050).
    • Numerically improved stickbreaking transformation - e.g. for the Dirichlet distribution. #4129
    • Enabled the Multinomial distribution to handle batch sizes that have more than 2 dimensions. #4169
    • ๐Ÿ‘€ Test model logp before starting any MCMC chains (see #4211)
    • โœ… Fix bug in model.check_test_point that caused the test_point argument to be ignored. (see PR #4211)
    • ๐Ÿ”จ Refactored MvNormal.random method with better handling of sample, batch and event shapes. #4207
    • The InverseGamma distribution now implements a logcdf. #3944
    • ๐Ÿ‘‰ Make starting jitter methods for nuts sampling more robust by resampling values that lead to non-finite probabilities. A new optional argument jitter-max-retries can be passed to pm.sample() and pm.init_nuts() to control the maximum number of retries per chain. 4298

    ๐Ÿ“š Documentation

    • โž• Added a new notebook demonstrating how to incorporate sampling from a conjugate Dirichlet-multinomial posterior density in conjunction with other step methods (see #4199).
    • ๐Ÿ‘€ Mentioned the way to do any random walk with theano.tensor.cumsum() in GaussianRandomWalk docstrings (see #4048).

    ๐Ÿš€ Release manager for 3.10.0: Eelke Spaak (@Spaak)