## Breaking changes - Code reorganization - `numpyro.mcmc` is moved to `numpyro.infer.mcmc` but all major classes are exposed in the `numpyro.infer` module. - `rng` argument to many classes and the `seed` handler has been more accurately renamed to `rng_key`. - Deprecated functions that formed the old interface like `mcmc` and `svi` have been removed. ## New Features - Improved turning condition for NUTS that results in much higher effective sample size for many models. - A [numpyro.plate](http://num.pyro.ai/en/latest/primitives.html#plate) context manager, which records conditional independence information in the trace and does automatic broadcasting, like in Pyro. - Inclusion of [AutoMultivariateNormal](http://num.pyro.ai/en/latest/autoguide.html#automultivariatenormal), [AutoLaplaceApproximation](http://num.pyro.ai/en/latest/autoguide.html#autolaplaceapproximation) to the [autoguide](http://num.pyro.ai/en/latest/autoguide.html) module. - More distributions like [LowRankMultivariateNormal](http://num.pyro.ai/en/latest/distributions.html#lowrankmultivariatenormal), [LKJ](http://num.pyro.ai/en/latest/distributions.html#lkj), [BetaBinomial](http://num.pyro.ai/en/latest/distributions.html#betabinomial), [GammaPoisson](http://num.pyro.ai/en/latest/distributions.html#gammapoisson), [ZeroInflatedPoisson](http://num.pyro.ai/en/latest/distributions.html#zeroinflatedpoisson), and [OrderedLogistic](http://num.pyro.ai/en/latest/distributions.html#orderedlogistic). - More transforms: [MultivariateAffineTransform](http://num.pyro.ai/en/latest/distributions.html#multivariateaffinetransform), [InvCholeskyTransform](http://num.pyro.ai/en/latest/distributions.html#invcholeskytransform), [OrderedTransform](http://num.pyro.ai/en/latest/distributions.html#orderedtransform). - A `numpyro.compat` module that supports the [pyro generic](https://github.com/pyro-ppl/pyro-api) API for modeling and inference that can dispatch to multiple Pyro backends. - Inclusion of [Independent](http://num.pyro.ai/en/latest/distributions.html#independent) distribution and [`Distribution.to_event`](http://num.pyro.ai/en/latest/distributions.html#numpyro.distributions.distribution.Distribution.to_event) method to convert independent batch dimensions to dependent event dimensions. See the Pyro tutorial on [tensor shapes](http://pyro.ai/examples/tensor_shapes.html#Reshaping-distributions) for more details. - A [Predictive](http://num.pyro.ai/en/latest/utilities.html#predictive) utility for generating samples from prior models, predictions from models using SVI's guide, or posterior samples from MCMC. - A [log_likelihood](http://num.pyro.ai/en/latest/utilities.html#log-likelihood) utility function that can compute the log likelihood for observed data by conditioning latent sites to values from the posterior distribution. - New [ClippedAdam](http://num.pyro.ai/en/latest/optimizers.html#clippedadam) optimizer to prevent exploding gradients. - New [RenyiELBO](http://num.pyro.ai/en/latest/svi.html#renyielbo) loss for Renyi divergence variational inference and importance weighted variational inference. ## Enhancements and Bug Fixes - MCMC does not throw an error on models with no latent sites. - [numpyro.seed](http://num.pyro.ai/en/latest/handlers.html#numpyro.handlers.seed) handler can be used as a context manager like: ```python with numpyro.seed(rng_seed=1): ... ``` - Utilities to enable [validation checks](http://num.pyro.ai/en/latest/utilities.html#numpyro.distributions.distribution.enable_validation) for distributions, set [host device count](http://num.pyro.ai/en/latest/utilities.html#set-host-device-count), and [platform](http://num.pyro.ai/en/latest/utilities.html#set-platform). - More efficient sampling from Binomial / Multinomial distributions. - The evidence lower bound loss for SVI is now a class called `ELBO`. - Add `energy` field to [HMCState](http://num.pyro.ai/en/latest/mcmc.html#numpyro.infer.mcmc.HMCState), which is used to compute [Bayesian Fraction of Missing Information](https://mc-stan.org/misc/warnings.html#bfmi-low) for diagnostics. - Add `init_strategy` arg to [HMC](http://num.pyro.ai/en/latest/mcmc.html#numpyro.infer.mcmc.HMC)/[NUTS](http://num.pyro.ai/en/latest/mcmc.html#numpyro.infer.mcmc.NUTS) classes, which allows users select various [initialization strategies](http://num.pyro.ai/en/latest/utilities.html#initialization-strategies).