12 views

Skip to first unread message

Apr 19, 2023, 2:45:53 AM4/19/23

to TensorFlow Probability

Lets say I have this random variables

normal_dist = tfd.MultivariateNormalDiag(loc=[-1, 0, 1])

normal_dist

normal_dist = tfd.MultivariateNormalDiag(loc=[-1, 0, 1])

normal_dist

Here we have 3 random variables (like 3 dice rolled simultaneously) So I we can think of it as independent (correct me if i am wrong plz)

Now if I do

normal_dist.prob([0.5, 0.2, 0.3])

This gives only one output, unlike batch where we have 3 distinct probabilities. So can we say it calculating the probability like

P(0.5) * P(0.2) * P(0.3)?

P(0.5) * P(0.2) * P(0.3)?

Apr 19, 2023, 2:53:17 AM4/19/23

to TensorFlow Probability, Gurkirat Singh

So I tried with the following example

normal_batch_dist = tfd.Normal(loc=normal_dist.loc, scale=1)

tf.reduce_prod(normal_batch_dist.prob([0.5, 0.2, 0.3]))

normal_batch_dist = tfd.Normal(loc=normal_dist.loc, scale=1)

tf.reduce_prod(normal_batch_dist.prob([0.5, 0.2, 0.3]))

The answer is same. It also makes sense because the outcome in multivariable with 3 random variable is like 3 blocks. In case of dice example (easy to explain) the sample size is 111 - 666 (three digit number means 3 random variables)

When we do normal_dist.prob([3, 5, 2]) It means that what is the probability of 352, which is (1 / 556) in this case (again correct me plz if I am wrong)

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu