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

layer_distribution_lambda

Keras layer enabling plumbing TFP distributions through Keras models


Description

Keras layer enabling plumbing TFP distributions through Keras models

Usage

layer_distribution_lambda(
  object,
  make_distribution_fn,
  convert_to_tensor_fn = tfp$distributions$Distribution$sample,
  ...
)

Arguments

object

Model or layer object

make_distribution_fn

A callable that takes previous layer outputs and returns a tfd$distributions$Distribution instance.

convert_to_tensor_fn

A callable that takes a tfd$Distribution instance and returns a tf$Tensor-like object. Default value: tfd$distributions$Distribution$sample.

...

Additional arguments passed to args of keras::create_layer.

Value

a Keras layer

See Also

For an example how to use in a Keras model, see layer_independent_normal().


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.