Imagine that I build a discrete random variable in tensorflow. There is a way to get the P(X = k) and associated probabilities ? i.e two lists [k_1 .., k_n] and [p_1,.., p_n] with p_i = P(X = k_i) ?
Get all informations of a discrete random variable in tensorflow
51 views Asked by JandSy At
1
How about
tfp.distributions.Categorical(logits=np.random.randn(10)).probs_parameter()
And if you wanted it to take on values different from 0..9, you could use
tfp.distributions.FiniteDiscrete