Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Get mcmc sampling to work #9
If we give it only the final logp function then we wont be able to sample traces of intermediate RVs.
And should the
graph.as_default() to create graph. So if you repeatedly call
model.unobserved it will spoil the namespace totally. The below snippet can replicate the problem
import tensorflow as tf graph = tf.get_default_graph() sess = tf.InteractiveSession(graph=graph) def model(): return tf.ones() model() model() model() graph.as_graph_def()
The output contains a lot of versions of tf.ones(). One way to solve the problem it to put all internal things into an auxiliary namespace.
It's not recommended to inherit from dict: