A simple and readable implementation of a 1-dimensional planar flow: z_K = z_0 + u * h(wz_0 + b)
planarflowmodel(u, w, b)A flow model object with methods:
sampleq(n)
logq(z0)
applyflow(z0)
Scalar parameter controlling the magnitude of the deformation.
Scalar parameter controlling the slope of the activation.
Scalar bias term.
where:
h is a smooth activation (tanh)
the log-determinant is computed analytically
This flow is mainly useful for pedagogical purposes or as a lightweight building block in variational inference.