TFGENZOO.flows.utils.gaussianize module¶
-
TFGENZOO.flows.utils.gaussianize.
gaussian_likelihood
(mean: tensorflow.python.framework.ops.Tensor, logsd: tensorflow.python.framework.ops.Tensor, x: tensorflow.python.framework.ops.Tensor)[source]¶ calculate negative log likelihood of Gaussian Distribution.
- Parameters
mean (tf.Tensor) – mean [B, …]
logsd (tf.Tensor) – log standard deviation [B, …]
x (tf.Tensor) – tensor [B, …]
- Returns
log likelihood [B, …]
- Return type
ll (tf.Tensor)
Note
\begin{align} ll &= - \cfrac{1}{2} (k\log(2 \pi) + \log |Var| \\ &+ (x - Mu)^T (Var ^ {-1}) (x - Mu))\\ ,\ where & \\ & k = 1\ (Independent)\\ & Var\ is\ a\ variance = exp(2 logsd) \end{align}
-
TFGENZOO.flows.utils.gaussianize.
gaussian_sample
(mean: tensorflow.python.framework.ops.Tensor, logsd: tensorflow.python.framework.ops.Tensor, temparature: float = 1.0)[source]¶ sampling from mean, logsd * temparature
- Parameters
mean (tf.Tensor) – mean [B, …]
logsd (tf.Tensor) – log standard deviation [B, …]
temparature (float) – temparature
- Returns
sampled latent variable [B, …]
- Return type
new_z(tf.Tensor)
- Noto:
I cann’t gurantee it’s correctness. Please open the tensorflow probability’s Issue.