Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Probabilistic-Programming-and-Bayesian-Methods-for-Hackers copied to clipboard
aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)
the print “Probability of belongs to cluster 1:” should be “Probability of belongs to cluster 0:” ?? or i miss the meanings?
Allows a user to successfully run the top setup cell of Ch1_Introduction_TFP. TensorFlow version is pinned to 1.13.1, the version running currently in Colab.
I am using google colab. How to you activate GPU usage for MCMC sampling? I am finding it very slow. And as building graphs is supposed to be faster than...
In ch2 Logistic example, when we assume our data follows logistic, why then use Bernoulli after that? In previous examples we only had an assumption of the data distribution and...
The double_joint_log_prob in ch2 A/B testing is not explained at all. Why do we return ( rv_prob_A.log_prob(prob_A) + rv_prob_B.log_prob(prob_B) + tf.reduce_sum(rv_obs_A.log_prob(observations_A)) + tf.reduce_sum(rv_obs_B.log_prob(observations_B)) ) would'nt this corrospond to finding the...
Hi there, on my system with tf-gpu this code makes trouble: ` [ lambda_1_samples, lambda_2_samples, posterior_tau, ], kernel_results = tfp.mcmc.sample_chain( num_results=1000, num_burnin_steps=100, current_state=initial_chain_state, kernel=tfp.mcmc.TransformedTransitionKernel( inner_kernel=tfp.mcmc.HamiltonianMonteCarlo( target_log_prob_fn=unnormalized_log_posterior, num_leapfrog_steps=2, step_size=step_size, step_size_update_fn=tfp.mcmc.make_simple_step_size_update_policy(), state_gradients_are_stopped=True),...
Hi @matthew-mcateer, could you please elaborate on the indtroduction of these lines in Chapter 3? `sds = tfd.Independent(tfd.Uniform(low=[0., 0.], high=[100., 100.]), reinterpreted_batch_ndims=1, name='sds')` At the moment the texts says >...
Running from colab. The TFP make_simple_step_size_update_policy requires a positional argument. Providing a value for the parameter "num_adaptation_steps:, produces different errors. Here is the original error message. WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from...
Hi there, The first line of the code for the Mandatory coin-flip example creates a random variable as follows: ``rv_coin_flip_prior = tfp.distributions.Bernoulli(probs=0.5, dtype=tf.int32)`` I think the variable name implies that...
p1 = tfd.Uniform(name='p', low=0., high=1.).sample() p2 = 1 - p1 p = tf.stack([p1, p2]) assignment = tfd.Categorical(name="assignment", probs=p) assignment_ = evaluate(assignment.sample(sample_shape=data_.shape[0], seed=42))[:10] print("prior assignment, with p = %.2f:" % evaluate(p1))...