Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tfb_real_nvp_default_template

Build a scale-and-shift function using a multi-layer neural network


Description

This will be wrapped in a make_template to ensure the variables are only created once. It takes the d-dimensional input x[0:d] and returns the D-d dimensional outputs loc ("mu") and log_scale ("alpha").

Usage

tfb_real_nvp_default_template(
  hidden_layers,
  shift_only = FALSE,
  activation = tf$nn$relu,
  name = NULL,
  ...
)

Arguments

hidden_layers

list-like of non-negative integer, scalars indicating the number of units in each hidden layer. Default: list(512, 512).

shift_only

logical indicating if only the shift term shall be computed (i.e. NICE bijector). Default: FALSE.

activation

Activation function (callable). Explicitly setting to NULL implies a linear activation.

name

A name for ops managed by this function. Default: "tfb_real_nvp_default_template".

...

tf$layers$dense arguments

Details

The default template does not support conditioning and will raise an exception if condition_kwargs are passed to it. To use conditioning in real nvp bijector, implement a conditioned shift/scale template that handles the condition_kwargs.

Value

list of:

  • shift: Float-like Tensor of shift terms

  • log_scale: Float-like Tensor of log(scale) terms

References

See Also


tfprobability

Interface to 'TensorFlow Probability'

v0.11.0.0
Apache License (>= 2.0)
Authors
Sigrid Keydana [aut, cre], Daniel Falbel [ctb], Kevin Kuo [ctb] (<https://orcid.org/0000-0001-7803-7901>), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.