zhusuan.transform

planar_normalizing_flow(samples, log_probs, n_iters)

Perform Planar Normalizing Flow along the last axis of inputs.

\[f(z_t) = z_{t-1} + h(z_{t-1} * w_t + b_t) * u_t\]

with activation function tanh as well as the invertibility trick from (Danilo 2016).

Parameters:
  • samples – A N-D (N>=2) float32 Tensor of shape […, d], and planar normalizing flow will be performed along the last axis.
  • log_probs – A (N-1)-D float32 Tensor, should be of the same shape as the first N-1 axes of samples.
  • n_iters – A int, which represents the number of successive flows.
Returns:

A N-D Tensor, the transformed samples.

Returns:

A (N-1)-D Tensor, the log probabilities of the transformed samples.