zhusuan.transform¶

planar_normalizing_flow
(samples, log_probs, n_iters)¶ Perform Planar Normalizing Flow along the last axis of inputs.
\[f(z_t) = z_{t1} + h(z_{t1} * w_t + b_t) * u_t\]with activation function tanh as well as the invertibility trick from (Danilo 2016).
Parameters:  samples – A ND (N>=2) float32 Tensor of shape […, d], and planar normalizing flow will be performed along the last axis.
 log_probs – A (N1)D float32 Tensor, should be of the same shape as the first N1 axes of samples.
 n_iters – A int, which represents the number of successive flows.
Returns: A ND Tensor, the transformed samples.
Returns: A (N1)D Tensor, the log probabilities of the transformed samples.