layer_autoregressive_transform {tfprobability} | R Documentation |
An autoregressive normalizing flow layer, given a layer_autoregressive
.
Description
Following Papamakarios et al. (2017), given
an autoregressive model with conditional distributions in the location-scale
family, we can construct a normalizing flow for
.
Usage
layer_autoregressive_transform(object, made, ...)
Arguments
object |
What to compose the new
|
made |
A |
... |
Additional parameters passed to Keras Layer. |
Details
Specifically, suppose made is a [layer_autoregressive()]
– a layer implementing
a Masked Autoencoder for Distribution Estimation (MADE) – that computes location
and log-scale parameters for each input
. Then we can represent
the autoregressive model
as
where
is drawn
from from some base distribution and where
is an invertible and
differentiable function (i.e., a Bijector) and
is defined by:
library(tensorflow) library(zeallot) f_inverse <- function(x) { c(shift, log_scale) %<-% tf$unstack(made(x), 2, axis = -1L) (x - shift) * tf$math$exp(-log_scale) }
Given a layer_autoregressive()
made, a layer_autoregressive_transform()
transforms an input tfd_*
to an output
tfd_*
where
.
Value
a Keras layer
References
See Also
tfb_masked_autoregressive_flow()
and layer_autoregressive()