Breaking Changes
- HMC's [find_heuristic_step_size](http://num.pyro.ai/en/latest/mcmc.html#numpyro.infer.hmc.HMC) (this functionality is different from step size adaptation scheme) is disabled by default to improve compiling time. Previous behavior can be enabled by setting `find_heuristic_step_size=True`.
- The automatic reparameterization mechanism introduced in NumPyro 0.2 is removed, in favor of `reparam` handler. See [the eight schools example](https://github.com/pyro-ppl/numpyro/#a-simple-example---8-schools) for the new usage pattern.
- [Automatic Guide Generation](http://num.pyro.ai/en/latest/autoguide.html) module is moved from `numpyro.contrib.autoguide` to the main inference module `numpyro.infer.autoguide`.
- Various API changes to match Pyro API:
+ [mask](http://num.pyro.ai/en/latest/handlers.html#mask) handler: `mask_array` arg is renamed to `mask`.
+ [scale](http://num.pyro.ai/en/latest/handlers.html#scale) handler: `scale_factor` arg is renamed to `scale`.
+ [condition](http://num.pyro.ai/en/latest/handlers.html#condition) and [substitute](http://num.pyro.ai/en/latest/handlers.html#substitute) handlers: `param_map` is renamed to `data`.
+ `MultivariateAffineTransform` transform is renamed to [LowerCholeskyAffine](http://num.pyro.ai/en/latest/distributions.html#lowercholeskyaffine).
+ `init_to_prior` strategy is renamed to [init_to_sample](http://num.pyro.ai/en/latest/utilities.html#init-to-sample).
New Features
- [Funsor-based NumPyro](http://num.pyro.ai/en/latest/funsor.html): allow enumeration over discrete latent variables. See mixture and Markov examples below for some applications.
- New primitives: [plate_stack](http://num.pyro.ai/en/latest/primitives.html#numpyro.primitives.plate_stack) and [scan](http://num.pyro.ai/en/latest/primitives.html#numpyro.contrib.control_flow.scan). If your model has Python `for` loop, considering using `scan` instead to improve compiling time.
- New handlers: [reparam](http://num.pyro.ai/en/latest/handlers.html#reparam), [scope](http://num.pyro.ai/en/latest/handlers.html#scope), and [lift](http://num.pyro.ai/en/latest/handlers.html#lift).
- New distributions: [von Mises](http://num.pyro.ai/en/latest/distributions.html#vonmises), [Gumbel](http://num.pyro.ai/en/latest/distributions.html#numpyro.distributions.continuous.Gumbel), [Logistic](http://num.pyro.ai/en/latest/distributions.html#logistic), [Laplace](http://num.pyro.ai/en/latest/distributions.html#laplace), [TruncatedPolyaGamma](http://num.pyro.ai/en/latest/distributions.html#truncatedpolyagamma), [ExpandedDistribution](http://num.pyro.ai/en/latest/distributions.html#expandeddistribution), [MaskedDistribution](http://num.pyro.ai/en/latest/distributions.html#maskeddistribution), and [ImproperUniform](http://num.pyro.ai/en/latest/distributions.html#improperuniform).
- [Distribution](http://num.pyro.ai/en/latest/distributions.html#numpyro.distributions.distribution.Distribution) has new properties `is_discrete`, `has_enumerate_support`, and new methods [shape](http://num.pyro.ai/en/latest/distributions.html#numpyro.distributions.distribution.Distribution.shape), [enumerate_support](http://num.pyro.ai/en/latest/distributions.html#numpyro.distributions.distribution.Distribution.enumerate_support), [expand](http://num.pyro.ai/en/latest/distributions.html#numpyro.distributions.distribution.Distribution.expand), [expand_by](http://num.pyro.ai/en/latest/distributions.html#numpyro.distributions.distribution.Distribution.expand_by), [mask](http://num.pyro.ai/en/latest/distributions.html#numpyro.distributions.distribution.Distribution.mask). In addition, `Distribution` has been registered as [a JAX Pytree](https://jax.readthedocs.io/en/latest/pytrees.html) class, with corresponding methods `tree_flatten` and `tree_unflatten`.
- New constraint: [less_than](http://num.pyro.ai/en/latest/distributions.html#less-than).
- Port [Tensor Indexing](http://num.pyro.ai/en/latest/utilities.html#module-numpyro.contrib.indexing) from Pyro.
- Port some [Reparameterizers](http://num.pyro.ai/en/latest/reparam.html) from Pyro.
- Add `batch_ndims` arg to [Predictive](http://num.pyro.ai/en/latest/utilities.html#numpyro.infer.util.Predictive) and [log_likelihood](http://num.pyro.ai/en/latest/utilities.html#numpyro.infer.util.log_likelihood) to allow using those utilities with arbitrary number of batch dimensions.
New Examples
- [Proportion Test example](http://pyro.ai/numpyro/examples/proportion_test.html): You are managing a business and want to test if calling your customers will increase their chance of making a purchase.
- [Bayesian Models of Annotation examples](http://pyro.ai/numpyro/examples/annotation.html): illustrates enumeration for mixture models.
- [Enumerate HMM examples](http://pyro.ai/numpyro/examples/hmm_enum.html): illustrates enumeration for markov models.
- [Bayesian Imputation tutorial](http://pyro.ai/numpyro/bayesian_imputation.html).
Enhancements and Bug Fixes
- HMC/NUTS compiling time is greatly improved, especially for large models.
- More efficient BTRS algorithm for sampling from Binomial distribution. 537
- Allow arbitrary order of `plate` statements. 555
- Fix KeyError with `scale` handler and `deterministic` primitive. 577
- Fix Poisson sampler entering into infinite loop under vmap. 582
- Fix the double compilation issue in `numpyro.optim` classes. 603
- Use ExpandedDistribution in `numpyro.plate`. 616
- [Timeseries forecasting tutorial](http://pyro.ai/numpyro/time_series_forecasting.html) is updated with `scan` primitive and the usage of `Predictive` for forecasting. #608 657
- Tweak sparse regression example to bring the model into exact alignment with the reference. 669
- Add MetropolisHastings algorithm as an example of [MCMCKernel](http://num.pyro.ai/en/stable/mcmc.html#numpyro.infer.mcmc.MCMCKernel). 680
Thanks Nikolaos daydreamt, Daniel Sheldon dsheldon, Lukas Prediger lumip, Freddy Boulton freddyaboulton, Wouter van Amsterdam vanAmsterdam, and many others for their contributions and helpful feedback!