Created
January 22, 2019 14:57
-
-
Save trungnt13/7fdcd611e460182b7678d092ce46793e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function, division, absolute_import | |
import tensorflow as tf | |
tf.enable_eager_execution() | |
from tensorflow_probability.python.distributions import NegativeBinomial | |
from zero_inflated import ZeroInflated | |
nb = NegativeBinomial(total_count=10, probs=0.5) | |
zfnb = ZeroInflated(dist=nb, pi=0.9) | |
# denoised values | |
print(nb.mean()) | |
# matching values of imputed data | |
print(zfnb.mean()) | |
print(zfnb.log_prob(10)) | |
# Note: zfnb.sample is not working recently |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment