Created
March 23, 2021 16:13
-
-
Save ckrapu/257e6343bdc9b92f14d4d93677c1de6d to your computer and use it in GitHub Desktop.
streaming-example-pymc3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pymc3 as pm | |
| with pm.Model() as model: | |
| x = pm.Normal('x', shape=2) | |
| step = pm.NUTS(x) | |
| gen = pm.iter_sample(5, step, tune=5, streaming=True) | |
| for trace in gen: | |
| print(trace) | |
| gen_full = pm.iter_sample(5, step, tune=5) | |
| for trace in gen_full: | |
| print(trace) | |
| standard_trace = pm.sample(draws=10, tune=10) | |
| print(standard_trace['x']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment