Skip to content

Instantly share code, notes, and snippets.

@ckrapu
Created March 23, 2021 16:13
Show Gist options
  • Save ckrapu/257e6343bdc9b92f14d4d93677c1de6d to your computer and use it in GitHub Desktop.
Save ckrapu/257e6343bdc9b92f14d4d93677c1de6d to your computer and use it in GitHub Desktop.
streaming-example-pymc3
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