Skip to content

Commit

Permalink
Bump to version 0.5.0 (#2075)
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajprad authored and fritzo committed Oct 23, 2019
1 parent 67d2bb6 commit 70534a0
Show file tree
Hide file tree
Showing 50 changed files with 64 additions and 50 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ cache:

install:
- pip install -U pip
# Keep track of pyro-api master branch
- pip install https://github.com/pyro-ppl/pyro-api/archive/master.zip
- pip install torch==1.3.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- pip install .[test]
- pip freeze
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ graphviz>=0.8
numpy>=1.7
observations>=0.1.4
opt_einsum>=2.3.2
pyro-api>=0.1.0
tqdm>=4.31
10 changes: 9 additions & 1 deletion docs/source/pyro.nn.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
AutoRegressiveNN
----------------

.. automodule:: pyro.nn.auto_reg_nn
.. autoclass:: pyro.nn.auto_reg_nn.AutoRegressiveNN
:members:
:undoc-members:
:show-inheritance:

ConditionalAutoRegressiveNN
---------------------------

.. autoclass:: pyro.nn.auto_reg_nn.ConditionalAutoRegressiveNN
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion examples/air/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def per_param_optim_args(module_name, param_name):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="Pyro AIR example", argument_default=argparse.SUPPRESS)
parser.add_argument('-n', '--num-steps', type=int, default=int(1e8),
help='number of optimization steps to take')
Expand Down
2 changes: 1 addition & 1 deletion examples/baseball.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def main(args):


if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="Baseball batting average using HMC")
parser.add_argument("-n", "--num-samples", nargs="?", default=200, type=int)
parser.add_argument("--num-chains", nargs='?', default=4, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/bayesian_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-epochs', default=1000, type=int)
parser.add_argument('-b', '--batch-size', default=N, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/autoname/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-epochs', default=200, type=int)
parser.add_argument('--jit', action='store_true')
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/autoname/scoping_mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def main(args):


if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-epochs', default=200, type=int)
args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/autoname/tree_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-epochs', default=100, type=int)
args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/gp/sv-dkl.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description='Pyro GP MNIST Example')
parser.add_argument('--data-dir', type=str, default=None, metavar='PATH',
help='default directory to cache MNIST data')
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/oed/ab_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def main(num_vi_steps, num_bo_steps, seed):


if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="A/B test experiment design using VI")
parser.add_argument("-n", "--num-vi-steps", nargs="?", default=5000, type=int)
parser.add_argument('--num-bo-steps', nargs="?", default=5, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/dmm/dmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def do_evaluation():

# parse command-line arguments and execute the main method
if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')

parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-epochs', type=int, default=5000)
Expand Down
2 changes: 1 addition & 1 deletion examples/eight_schools/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description='Eight Schools MCMC')
parser.add_argument('--num-samples', type=int, default=1000,
help='number of MCMC samples (default: 1000)')
Expand Down
2 changes: 1 addition & 1 deletion examples/eight_schools/svi.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description='Eight Schools SVI')
parser.add_argument('--lr', type=float, default=0.01,
help='learning rate (default: 0.01)')
Expand Down
2 changes: 1 addition & 1 deletion examples/hmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="MAP Baum-Welch learning Bach Chorales")
parser.add_argument("-m", "--model", default="1", type=str,
help="one of: {}".format(", ".join(sorted(models.keys()))))
Expand Down
2 changes: 1 addition & 1 deletion examples/inclined_plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-samples', default=500, type=int)
args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion examples/lda.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="Amortized Latent Dirichlet Allocation")
parser.add_argument("-t", "--num-topics", default=8, type=int)
parser.add_argument("-w", "--num-words", default=1024, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/lkj.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def main(args):


if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="Demonstrate the use of an LKJ Prior")
parser.add_argument("--num-samples", nargs="?", default=200, type=int)
parser.add_argument("--n", nargs="?", default=500, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/minipyro.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def guide(data):


if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="Mini Pyro demo")
parser.add_argument("-b", "--backend", default="minipyro")
parser.add_argument("-n", "--num-steps", default=1001, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/rsa/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def main(args):


if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-samples', default=10, type=int)
args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion examples/rsa/hyperbole.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def main(args):


if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-samples', default=10, type=int)
parser.add_argument('--price', default=10000, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/rsa/schelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-samples', default=10, type=int)
parser.add_argument('--depth', default=2, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/rsa/schelling_false.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-samples', default=10, type=int)
parser.add_argument('--depth', default=3, type=int)
Expand Down
2 changes: 1 addition & 1 deletion examples/rsa/semantic_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def is_all_qud(world):


if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-samples', default=10, type=int)
args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion examples/sparse_gamma_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
# parse command line arguments
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-epochs', default=1500, type=int, help='number of training epochs')
Expand Down
2 changes: 1 addition & 1 deletion examples/sparse_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description='Krylov KIT')
parser.add_argument('--num-data', type=int, default=750)
parser.add_argument('--num-steps', type=int, default=1000)
Expand Down
2 changes: 1 addition & 1 deletion examples/vae/ss_vae_M2.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def main(args):
"-sup 3000 -zd 50 -hl 500 -lr 0.00042 -b1 0.95 -bs 200 -log ./tmp.log"

if __name__ == "__main__":
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')

parser = argparse.ArgumentParser(description="SS-VAE\n{}".format(EXAMPLE_RUN))

Expand Down
2 changes: 1 addition & 1 deletion examples/vae/vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
# parse command line arguments
parser = argparse.ArgumentParser(description="parse args")
parser.add_argument('-n', '--num-epochs', default=101, type=int, help='number of training epochs')
Expand Down
2 changes: 1 addition & 1 deletion examples/vae/vae_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def main(args):


if __name__ == '__main__':
assert pyro.__version__.startswith('0.4.1')
assert pyro.__version__.startswith('0.5.0')
parser = argparse.ArgumentParser(description='VAE using MNIST dataset')
parser.add_argument('-n', '--num-epochs', nargs='?', default=10, type=int)
parser.add_argument('--batch_size', nargs='?', default=128, type=int)
Expand Down
2 changes: 1 addition & 1 deletion pyro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
param, plate, plate_stack, random_module, sample, validation_enabled)
from pyro.util import set_rng_seed

version_prefix = '0.4.1'
version_prefix = '0.5.0'

# Get the __version__ string from the auto-generated _version.py file, if exists.
try:
Expand Down
5 changes: 2 additions & 3 deletions pyro/infer/abstract_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ def __init__(self, model, posterior, num_samples, keep_sites=None):
self.num_samples = num_samples
self.keep_sites = keep_sites
super(TracePredictive, self).__init__()
warnings.warn('This class will be deprecated in the next release. For MCMC, '
'please use the `pyro.infer.mcmc.util.predictive` function '
'instead.', PendingDeprecationWarning)
warnings.warn('This class will be removed in the next release. Use the '
'`pyro.infer.Predictive` class instead.', DeprecationWarning)

def _traces(self, *args, **kwargs):
if not self.posterior.exec_traces:
Expand Down
2 changes: 1 addition & 1 deletion pyro/infer/elbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ELBO(object, metaclass=ABCMeta):
tracer. When this is True, all :class:`torch.jit.TracerWarning` will
be ignored. Defaults to False.
:param bool jit_options: Optional dict of options to pass to
:func:`torch.jit.trace` , e.g. ``{"optimize": False}``.
:func:`torch.jit.trace` , e.g. ``{"check_trace": True}``.
:param bool retain_graph: Whether to retain autograd graph during an SVI
step. Defaults to None (False).
:param float tail_adaptive_beta: Exponent beta with ``-1.0 <= beta < 0.0`` for
Expand Down
5 changes: 5 additions & 0 deletions pyro/infer/svi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import warnings

import torch

import pyro
Expand Down Expand Up @@ -62,6 +64,9 @@ def _loss_and_grads(*args, **kwargs):
self.loss_and_grads = loss_and_grads

def run(self, *args, **kwargs):
warnings.warn('SVI will not derive from TracePosterior, and this method might be '
'unavailable in future releases. For predictions, use the '
'`pyro.infer.Predictive` class directly.', DeprecationWarning)
if self.num_steps > 0:
with poutine.block():
for i in range(self.num_steps):
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
# numpy is necessary for some functionality of PyTorch
'numpy>=1.7',
'opt_einsum>=2.3.2',
'pyro-api@https://api.github.com/repos/pyro-ppl/pyro-api/tarball/master',
'pyro-api>=0.1.0',
'torch>=1.2.0',
'tqdm>=4.31',
],
Expand Down Expand Up @@ -114,7 +114,6 @@
'yapf',
],
},
tests_require=['flake8', 'pytest>=4.1'],
keywords='machine learning statistics probabilistic programming bayesian modeling pytorch',
license='MIT License',
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion tutorial/source/air.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"import numpy as np\n",
"\n",
"smoke_test = ('CI' in os.environ)\n",
"assert pyro.__version__.startswith('0.4.1')\n",
"assert pyro.__version__.startswith('0.5.0')\n",
"pyro.enable_validation(True)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion tutorial/source/bayesian_regression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"\n",
"# for CI testing\n",
"smoke_test = ('CI' in os.environ)\n",
"assert pyro.__version__.startswith('0.4.1')\n",
"assert pyro.__version__.startswith('0.5.0')\n",
"pyro.enable_validation(True)\n",
"pyro.set_rng_seed(1)\n",
"pyro.enable_validation(True)\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorial/source/bayesian_regression_ii.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"import pyro.optim as optim\n",
"\n",
"pyro.set_rng_seed(1)\n",
"assert pyro.__version__.startswith('0.4.1')"
"assert pyro.__version__.startswith('0.5.0')"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion tutorial/source/bo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"import pyro\n",
"import pyro.contrib.gp as gp\n",
"\n",
"assert pyro.__version__.startswith('0.4.1')\n",
"assert pyro.__version__.startswith('0.5.0')\n",
"pyro.enable_validation(True) # can help with debugging\n",
"pyro.set_rng_seed(1)"
]
Expand Down
2 changes: 1 addition & 1 deletion tutorial/source/easyguide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"\n",
"pyro.enable_validation(True)\n",
"smoke_test = ('CI' in os.environ)\n",
"assert pyro.__version__.startswith('0.4.1')"
"assert pyro.__version__.startswith('0.5.0')"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion tutorial/source/ekf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"from pyro.contrib.tracking.measurements import PositionMeasurement\n",
"\n",
"smoke_test = ('CI' in os.environ)\n",
"assert pyro.__version__.startswith('0.4.1')\n",
"assert pyro.__version__.startswith('0.5.0')\n",
"pyro.enable_validation(True)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion tutorial/source/enumeration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"from pyro.ops.indexing import Vindex\n",
"\n",
"smoke_test = ('CI' in os.environ)\n",
"assert pyro.__version__.startswith('0.4.1')\n",
"assert pyro.__version__.startswith('0.5.0')\n",
"pyro.enable_validation()\n",
"pyro.set_rng_seed(0)"
]
Expand Down
Loading

0 comments on commit 70534a0

Please sign in to comment.