<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/layers/__init__.py) |

Probabilistic Layers.

## Modules

[`conv_variational`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/conv_variational) module: Convolutional variational layers.

[`dense_variational`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/dense_variational) module: Dense variational layers.

[`dense_variational_v2`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/dense_variational_v2) module: DenseVariational layer.

[`distribution_layer`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/distribution_layer) module: Layers for combining [`tfp.distributions`](https://www.tensorflow.org/probability/api_docs/python/tfp/distributions) and `tf_keras`.

[`initializers`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/initializers) module: Keras initializers useful for TFP Keras layers.

[`masked_autoregressive`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/masked_autoregressive) module: Layers for normalizing flows and masked autoregressive density estimation.

[`util`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/util) module: Utilities for probabilistic layers.

[`variable_input`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/variable_input) module: VariableInputLayer.

[`weight_norm`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/weight_norm) module: Layer wrapper for weight normalization.

## Classes

[`class AutoregressiveTransform`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/AutoregressiveTransform): An autoregressive normalizing flow layer.

[`class BlockwiseInitializer`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/BlockwiseInitializer): Initializer which concats other intializers.

[`class CategoricalMixtureOfOneHotCategorical`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/CategoricalMixtureOfOneHotCategorical): A OneHotCategorical mixture Keras layer from `k * (1 + d)` params.

[`class Convolution1DFlipout`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/Convolution1DFlipout): 1D convolution layer (e.g. temporal convolution) with Flipout.

[`class Convolution1DReparameterization`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/Convolution1DReparameterization): 1D convolution layer (e.g. temporal convolution).

[`class Convolution2DFlipout`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/Convolution2DFlipout): 2D convolution layer (e.g. spatial convolution over images) with Flipout.

[`class Convolution2DReparameterization`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/Convolution2DReparameterization): 2D convolution layer (e.g. spatial convolution over images).

[`class Convolution3DFlipout`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/Convolution3DFlipout): 3D convolution layer (e.g. spatial convolution over volumes) with Flipout.

[`class Convolution3DReparameterization`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/Convolution3DReparameterization): 3D convolution layer (e.g. spatial convolution over volumes).

[`class DenseFlipout`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/DenseFlipout): Densely-connected layer class with Flipout estimator.

[`class DenseLocalReparameterization`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/DenseLocalReparameterization): Densely-connected layer class with local reparameterization estimator.

[`class DenseReparameterization`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/DenseReparameterization): Densely-connected layer class with reparameterization estimator.

[`class DenseVariational`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/DenseVariational): Dense layer with random `kernel` and `bias`.

[`class DistributionLambda`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/DistributionLambda): Keras layer enabling plumbing TFP distributions through Keras models.

[`class IndependentBernoulli`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/IndependentBernoulli): An Independent-Bernoulli Keras layer from `prod(event_shape)` params.

[`class IndependentLogistic`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/IndependentLogistic): An independent logistic Keras layer.

[`class IndependentNormal`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/IndependentNormal): An independent normal Keras layer.

[`class IndependentPoisson`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/IndependentPoisson): An independent Poisson Keras layer.

[`class KLDivergenceAddLoss`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/KLDivergenceAddLoss): Pass-through layer that adds a KL divergence penalty to the model loss.

[`class KLDivergenceRegularizer`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/KLDivergenceRegularizer): Regularizer that adds a KL divergence penalty to the model loss.

[`class MixtureLogistic`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/MixtureLogistic): A mixture distribution Keras layer, with independent logistic components.

[`class MixtureNormal`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/MixtureNormal): A mixture distribution Keras layer, with independent normal components.

[`class MixtureSameFamily`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/MixtureSameFamily): A mixture (same-family) Keras layer.

[`class MultivariateNormalTriL`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/MultivariateNormalTriL): A `d`-variate MVNTriL Keras layer from `d + d * (d + 1) // 2` params.

[`class OneHotCategorical`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/OneHotCategorical): A `d`-variate OneHotCategorical Keras layer from `d` params.

[`class VariableLayer`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/VariableLayer): Simply returns a (trainable) variable, regardless of input.

[`class VariationalGaussianProcess`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/VariationalGaussianProcess): A VariationalGaussianProcess Layer.

## Functions

[`default_loc_scale_fn(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/default_loc_scale_fn): Makes closure which creates `loc`, `scale` params from `tf.get_variable`.

[`default_mean_field_normal_fn(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/default_mean_field_normal_fn): Creates a function to build Normal distributions with trainable params.

[`default_multivariate_normal_fn(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/layers/default_multivariate_normal_fn): Creates multivariate standard `Normal` distribution.