torchbayesian.bnn#

Short description.

Containers#

BayesianModule

This class is a Torch 'nn.Module' container that reparametrizes in-place the 'nn.Parameter' parameters of any torch model or module with a variational posterior, and allows computation of the KL divergence.

Layers#

Description.

BayesianModule

This class is a Torch 'nn.Module' container that reparametrizes in-place the 'nn.Parameter' parameters of any torch model or module with a variational posterior, and allows computation of the KL divergence.

Bayesian Dropout Layers#

Description.

BayesianAlphaDropout

This class is an implementation of 'torch.nn.AlphaDropout' that remains active in eval mode.

BayesianDropout

This class is an implementation of 'torch.nn.Dropout' that remains active in eval mode.

BayesianDropout1d

This class is an implementation of 'torch.nn.Dropout1d' that remains active in eval mode.

BayesianDropout2d

This class is an implementation of 'torch.nn.Dropout2d' that remains active in eval mode.

BayesianDropout3d

This class is an implementation of 'torch.nn.Dropout3d' that remains active in eval mode.

BayesianFeatureAlphaDropout

This class is an implementation of 'torch.nn.FeatureAlphaDropout' that remains active in eval mode.

Variational Posteriors#

Description.

VariationalPosterior

This class serves as a base class for all variational posteriors used for Bayes by Backprop (BBB) variational inference (VI).

GaussianPosterior

This class is a diagonal Gaussian variational posterior.

PretrainedGaussianPosterior

This class is a diagonal Gaussian variational posterior whose mean parameter is initialized from an existing tensor.

Priors#

Description.

Prior

This class serves as a base class for all priors used for Bayes by backprop (BBB) variational inference (VI).

GaussianPrior

This class is a diagonal Gaussian prior distribution used for Bayes by Backprop (BBB).