Skip to content

found typo #2177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions pymc3/theanof.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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

Expand All @@ -394,7 +379,6 @@ def tt_rng(random_seed=None):
return _tt_rng
else:
ret = MRG_RandomStreams(random_seed)
launch_rng(ret)
return ret


Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions pymc3/variational/approximations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions pymc3/variational/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pymc3/variational/opvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down