Skip to content

Commit

Permalink
MAINT Convert some examples to new sample() api. Adapt tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
twiecki committed Nov 17, 2016
1 parent 85e0f9d commit 34e3f45
Show file tree
Hide file tree
Showing 10 changed files with 361 additions and 626 deletions.
83 changes: 25 additions & 58 deletions docs/source/notebooks/BEST.ipynb

Large diffs are not rendered by default.

136 changes: 27 additions & 109 deletions docs/source/notebooks/GLM-hierarchical.ipynb

Large diffs are not rendered by default.

100 changes: 36 additions & 64 deletions docs/source/notebooks/LKJ.ipynb

Large diffs are not rendered by default.

198 changes: 111 additions & 87 deletions docs/source/notebooks/NUTS_scaling_using_ADVI.ipynb

Large diffs are not rendered by default.

91 changes: 46 additions & 45 deletions docs/source/notebooks/cox_model.ipynb

Large diffs are not rendered by default.

Expand Up @@ -292,8 +292,9 @@
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python [default]",
"language": "python",
"name": "python3"
},
Expand All @@ -307,11 +308,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
},
"widgets": {
"state": {},
"version": "1.1.2"
"version": "3.5.2"
}
},
"nbformat": 4,
Expand Down
143 changes: 55 additions & 88 deletions docs/source/notebooks/pmf-pymc.ipynb

Large diffs are not rendered by default.

133 changes: 34 additions & 99 deletions docs/source/notebooks/posterior_predictive.ipynb

Large diffs are not rendered by default.

82 changes: 21 additions & 61 deletions docs/source/notebooks/stochastic_volatility.ipynb

Large diffs are not rendered by default.

12 changes: 3 additions & 9 deletions pymc3/tests/test_sampling.py
Expand Up @@ -64,15 +64,9 @@ def test_sample(self):
def test_sample_init(self):
with self.model:
for init in ('advi', 'advi_map', 'map', 'nuts'):
for sampler in ('nuts', 'hmc', 'advi'):
if (sampler == 'advi') and (init != 'advi'):
self.assertRaises(ValueError, pm.sample_init,
init=init, sampler=sampler,
n_init=1000)
else:
pm.sample_init(init=init, sampler=sampler,
n_init=1000, draws=50,
random_seed=self.random_seed)
pm.sample(init=init,
n_init=1000, draws=50,
random_seed=self.random_seed)


def test_iter_sample(self):
Expand Down

0 comments on commit 34e3f45

Please sign in to comment.