diff --git a/docs/source/distributions.rst b/docs/source/distributions.rst index 93341d6e8..7b7839087 100644 --- a/docs/source/distributions.rst +++ b/docs/source/distributions.rst @@ -117,6 +117,14 @@ LogNormal :show-inheritance: :member-order: bysource +MultivariateNormal +------------------ +.. autoclass:: numpyro.distributions.continuous.MultivariateNormal + :members: + :undoc-members: + :show-inheritance: + :member-order: bysource + Normal ------ .. autoclass:: numpyro.distributions.continuous.Normal @@ -265,6 +273,13 @@ Poisson :show-inheritance: :member-order: bysource +PRNGIdentity +------------ +.. autoclass:: numpyro.distributions.discrete.PRNGIdentity + :members: + :undoc-members: + :show-inheritance: + :member-order: bysource Constraints =========== diff --git a/examples/baseball.py b/examples/baseball.py index 4cd89253e..be3b1f4ba 100644 --- a/examples/baseball.py +++ b/examples/baseball.py @@ -197,6 +197,7 @@ def main(args): if __name__ == "__main__": + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="Baseball batting average using HMC") parser.add_argument("-n", "--num-samples", nargs="?", default=3000, type=int) parser.add_argument("--num-warmup", nargs='?', default=1500, type=int) diff --git a/examples/bnn.py b/examples/bnn.py index 09f422cd7..c860455be 100644 --- a/examples/bnn.py +++ b/examples/bnn.py @@ -132,6 +132,7 @@ def main(args): if __name__ == "__main__": + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="Bayesian neural network example") parser.add_argument("-n", "--num-samples", nargs="?", default=2000, type=int) parser.add_argument("--num-warmup", nargs='?', default=1000, type=int) diff --git a/examples/covtype.py b/examples/covtype.py index ffde031b2..e11e86e64 100644 --- a/examples/covtype.py +++ b/examples/covtype.py @@ -59,6 +59,7 @@ def main(args): if __name__ == '__main__': + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="parse args") parser.add_argument('-n', '--num-samples', default=100, type=int, help='number of samples') parser.add_argument('--num-steps', default=10, type=int, help='number of steps (for "HMC")') diff --git a/examples/funnel.py b/examples/funnel.py index 1cf18e304..9869a7489 100644 --- a/examples/funnel.py +++ b/examples/funnel.py @@ -81,6 +81,7 @@ def main(args): if __name__ == "__main__": + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="Non-centered reparameterization example") parser.add_argument("-n", "--num-samples", nargs="?", default=1000, type=int) parser.add_argument("--num-warmup", nargs='?', default=1000, type=int) diff --git a/examples/gp.py b/examples/gp.py index c48507438..29a35ef67 100644 --- a/examples/gp.py +++ b/examples/gp.py @@ -123,6 +123,7 @@ def main(args): if __name__ == "__main__": + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="Gaussian Process example") parser.add_argument("-n", "--num-samples", nargs="?", default=1000, type=int) parser.add_argument("--num-warmup", nargs='?', default=1000, type=int) diff --git a/examples/hmm.py b/examples/hmm.py index 0ec24e6af..ef6350270 100644 --- a/examples/hmm.py +++ b/examples/hmm.py @@ -161,6 +161,7 @@ def main(args): if __name__ == '__main__': + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description='Semi-supervised Hidden Markov Model') parser.add_argument('--num-categories', default=3, type=int) parser.add_argument('--num-words', default=10, type=int) diff --git a/examples/minipyro.py b/examples/minipyro.py index 2e3caa609..f4c7e1f3f 100644 --- a/examples/minipyro.py +++ b/examples/minipyro.py @@ -54,6 +54,7 @@ def body_fn(i, val): if __name__ == "__main__": + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="Mini Pyro demo") parser.add_argument("-f", "--full-pyro", action="store_true", default=False) parser.add_argument("-n", "--num-steps", default=1001, type=int) diff --git a/examples/neutra.py b/examples/neutra.py index 358c59b5b..a9bd5e244 100644 --- a/examples/neutra.py +++ b/examples/neutra.py @@ -149,6 +149,7 @@ def main(args): if __name__ == "__main__": + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="NeuTra HMC") parser.add_argument('-n', '--num-samples', nargs='?', default=20000, type=int) parser.add_argument('--num-warmup', nargs='?', default=0, type=int) diff --git a/examples/sparse_regression.py b/examples/sparse_regression.py index 4a400eb42..9d607221d 100644 --- a/examples/sparse_regression.py +++ b/examples/sparse_regression.py @@ -315,6 +315,7 @@ def main(args): if __name__ == "__main__": + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="Gaussian Process example") parser.add_argument("-n", "--num-samples", nargs="?", default=1000, type=int) parser.add_argument("--num-warmup", nargs='?', default=500, type=int) diff --git a/examples/stochastic_volatility.py b/examples/stochastic_volatility.py index 023978205..249050030 100644 --- a/examples/stochastic_volatility.py +++ b/examples/stochastic_volatility.py @@ -77,6 +77,7 @@ def main(args): if __name__ == "__main__": + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="Stochastic Volatility Model") parser.add_argument('-n', '--num-samples', nargs='?', default=3000, type=int) parser.add_argument('--num-warmup', nargs='?', default=1500, type=int) diff --git a/examples/ucbadmit.py b/examples/ucbadmit.py index 105867607..d36b17bae 100644 --- a/examples/ucbadmit.py +++ b/examples/ucbadmit.py @@ -104,6 +104,7 @@ def main(args): if __name__ == '__main__': + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description='UCBadmit gender discrimination using HMC') parser.add_argument('-n', '--num-samples', nargs='?', default=2000, type=int) parser.add_argument('--num-warmup', nargs='?', default=500, type=int) diff --git a/examples/vae.py b/examples/vae.py index 0d36ed73a..ab0166c50 100644 --- a/examples/vae.py +++ b/examples/vae.py @@ -124,6 +124,7 @@ def reconstruct_img(epoch, rng): if __name__ == '__main__': + assert numpyro.__version__.startswith('0.2.0') parser = argparse.ArgumentParser(description="parse args") parser.add_argument('-n', '--num-epochs', default=20, type=int, help='number of training epochs') parser.add_argument('-lr', '--learning-rate', default=1.0e-3, type=float, help='learning rate') diff --git a/notebooks/source/bayesian_regression.ipynb b/notebooks/source/bayesian_regression.ipynb index d62f71c70..f72e5b066 100644 --- a/notebooks/source/bayesian_regression.ipynb +++ b/notebooks/source/bayesian_regression.ipynb @@ -64,7 +64,8 @@ " 'xtick.labelsize': 14,\n", " 'ytick.labelsize': 14,\n", " 'axes.titlesize': 'large', \n", - " 'axes.labelsize': 'medium'})" + " 'axes.labelsize': 'medium'})\n", + "assert numpyro.__version__.startswith('0.2.0')\n" ] }, { diff --git a/notebooks/source/logistic_regression.ipynb b/notebooks/source/logistic_regression.ipynb index f96ec06fc..67c710ef3 100644 --- a/notebooks/source/logistic_regression.ipynb +++ b/notebooks/source/logistic_regression.ipynb @@ -35,7 +35,8 @@ "from numpyro.examples.datasets import COVTYPE, load_dataset\n", "from numpyro.hmc_util import initialize_model\n", "from numpyro.mcmc import hmc, mcmc\n", - "from numpyro.util import fori_collect" + "from numpyro.util import fori_collect\n", + "assert numpyro.__version__.startswith('0.2.0')\n" ] }, { diff --git a/notebooks/source/time_series_forecasting.ipynb b/notebooks/source/time_series_forecasting.ipynb index 14367f83c..cc2d91c46 100644 --- a/notebooks/source/time_series_forecasting.ipynb +++ b/notebooks/source/time_series_forecasting.ipynb @@ -38,7 +38,8 @@ "from numpyro.diagnostics import autocorrelation, hpdi\n", "from numpyro.distributions.util import softmax\n", "from numpyro import handlers\n", - "from numpyro.mcmc import MCMC, NUTS" + "from numpyro.mcmc import MCMC, NUTS\n", + "assert numpyro.__version__.startswith('0.2.0')\n" ] }, { diff --git a/numpyro/version.py b/numpyro/version.py index b794fd409..7fd229a32 100644 --- a/numpyro/version.py +++ b/numpyro/version.py @@ -1 +1 @@ -__version__ = '0.1.0' +__version__ = '0.2.0' diff --git a/setup.py b/setup.py index e9fbe9919..9a8d5df46 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name='numpyro', - version='0.1.0', + version=version, description='Pyro PPL on Numpy', packages=find_packages(include=['numpyro', 'numpyro.*']), url='https://github.com/pyro-ppl/numpyro',