From f23e66d2f8deb8c505db991d72755bdaa49fb7dc Mon Sep 17 00:00:00 2001 From: Maxim Kochurov Date: Fri, 12 May 2017 12:48:00 +0300 Subject: [PATCH] found typo --- pymc3/theanof.py | 19 +------------------ pymc3/variational/approximations.py | 6 +++--- pymc3/variational/inference.py | 14 +++++++------- pymc3/variational/opvi.py | 4 ++-- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/pymc3/theanof.py b/pymc3/theanof.py index 9f349d0544..ed5225cc08 100644 --- a/pymc3/theanof.py +++ b/pymc3/theanof.py @@ -356,22 +356,7 @@ def generator(gen, default=None): return GeneratorOp(gen, default)() -@change_flags(compute_test_value='off') -def launch_rng(rng): - """ - Helper function for safe launch of theano random generator. - If not launched, there will be problems with test_value - - Parameters - ---------- - rng : `theano.sandbox.rng_mrg.MRG_RandomStreams` instance - """ - state = rng.rstate - rng.inc_rstate() - rng.set_rstate(state) - _tt_rng = MRG_RandomStreams() -launch_rng(_tt_rng) def tt_rng(random_seed=None): @@ -380,7 +365,7 @@ def tt_rng(random_seed=None): Parameters ---------- - seed : int + random_seed : int If not None returns *new* theano random generator without replacing package global one @@ -394,7 +379,6 @@ def tt_rng(random_seed=None): return _tt_rng else: ret = MRG_RandomStreams(random_seed) - launch_rng(ret) return ret @@ -413,7 +397,6 @@ def set_tt_rng(new_rng): if isinstance(new_rng, int): new_rng = MRG_RandomStreams(new_rng) _tt_rng = new_rng - launch_rng(_tt_rng) def floatX_array(x): diff --git a/pymc3/variational/approximations.py b/pymc3/variational/approximations.py index ff10105d9d..139ef48eb9 100644 --- a/pymc3/variational/approximations.py +++ b/pymc3/variational/approximations.py @@ -40,7 +40,7 @@ class MeanField(Approximation): Yuhuai Wu, David Duvenaud, 2016) for details scale_cost_to_minibatch : `bool` Scale cost to minibatch instead of full dataset, default False - seed : None or int + random seed : None or int leave None to use package global RandomStream or other valid value to create instance specific one @@ -263,7 +263,7 @@ class Empirical(Approximation): Scale cost to minibatch instead of full dataset, default False model : :class:`Model` PyMC3 model for inference - seed : None or int + random_seed : None or int leave None to use package global RandomStream or other valid value to create instance specific one @@ -375,7 +375,7 @@ def from_noise(cls, size, jitter=.01, local_rv=None, initial point model : :class:`Model` PyMC3 model for inference - seed : None or int + random_seed : None or int leave None to use package global RandomStream or other valid value to create instance specific one kwargs : other kwargs passed to init diff --git a/pymc3/variational/inference.py b/pymc3/variational/inference.py index 3065962237..c67452b9b4 100644 --- a/pymc3/variational/inference.py +++ b/pymc3/variational/inference.py @@ -312,7 +312,7 @@ class ADVI(Inference): Yuhuai Wu, David Duvenaud, 2016) for details scale_cost_to_minibatch : `bool` Scale cost to minibatch instead of full dataset, default False - seed : None or int + random_seed : None or int leave None to use package global RandomStream or other valid value to create instance specific one start : `Point` @@ -560,19 +560,19 @@ def fit(n=10000, local_rv=None, method='advi', model=None, random_seed=None, sta Local Vars are used for Autoencoding Variational Bayes See (AEVB; Kingma and Welling, 2014) for details method : str or :class:`Inference` - string name is case insensitive in {'advi', 'fullrank_advi', 'advi->fullrank_advi'} + string name is case insensitive in {'advi', 'fullrank_advi', 'advi->fullrank_advi', 'svgd'} model : :class:`Model` PyMC3 model for inference - - Other Parameters - ---------------- - frac : `float` - if method is 'advi->fullrank_advi' represents advi fraction when training random_seed : None or int leave None to use package global RandomStream or other valid value to create instance specific one start : `Point` starting point for inference + + Other Parameters + ---------------- + frac : `float` + if method is 'advi->fullrank_advi' represents advi fraction when training kwargs : kwargs for :method:`Inference.fit` Returns diff --git a/pymc3/variational/opvi.py b/pymc3/variational/opvi.py index 7817c63873..7c510730ed 100644 --- a/pymc3/variational/opvi.py +++ b/pymc3/variational/opvi.py @@ -562,10 +562,10 @@ def seed(self, random_seed=None): Parameters ---------- - seed : `int` + random_seed : `int` """ self._seed = random_seed - self._rng.seed(seed) + self._rng.seed(random_seed) @property def normalizing_constant(self):