An Independent-Bernoulli Keras layer from prod(event_shape) params

layer_independent_bernoulli(
  object,
  event_shape,
  convert_to_tensor_fn = tfp$distributions$Distribution$sample,
  sample_dtype = NULL,
  validate_args = FALSE,
  ...
)

Arguments

object

Model or layer object

event_shape

Scalar integer representing the size of single draw from this distribution.

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.

sample_dtype

dtype of samples produced by this distribution. Default value: NULL (i.e., previous layer's dtype).

validate_args

Logical, default FALSE. When TRUE distribution parameters are checked for validity despite possibly degrading runtime performance. When FALSE invalid inputs may silently render incorrect outputs. Default value: FALSE. @param ... Additional arguments passed to args of keras::create_layer.

...

Additional arguments passed to args of keras::create_layer.

Value

a Keras layer

See also