API Reference

PyTorch implementation of Assumed Density Filtering (ADF) based probabilistic neural networks.

This package provides implementations of several ADF based probabilistic buildings blocks commonly used in neural networks. They are to be used within the framework of PyTorch. Unlike standard (deterministic) PyTorch layers that propagate point estimates, the corresponding probabilsitic ADF layers propagate a distribution parametrized by its mean and (co-)variance.

What follows is the API explanation. This mostly just lists functions and their options and is intended for quickly looking up things.

If you like a more hands-on introduction, have a look at our Examples.

torchadf.nn

Expose the modules directly under torchadf.nn

Collects aliases of all the supported layers in submodules of the package. See below for details on the individual submodules.

torchadf.nn.modules.container

Below is a list of model containers in the package.

Sequential(*args)

A sequential container for passing along pairs of inputs to outputs.

torchadf.nn.modules.activation

Below is a list of supported activation function layers in the package.

ReLU([mode])

Rectified Linear Unit.

torchadf.nn.modules.conv

Below is a list of supported convolution layers in the package.

Conv1d(in_channels, out_channels, kernel_size)

A 1D convolution layer.

Conv2d(in_channels, out_channels, kernel_size)

A 2D convolution layer.

Conv3d(in_channels, out_channels, kernel_size)

A 3D convolution layer.

torchadf.nn.modules.flatten

Below is a list of reshaping layers in the package.

Flatten([start_dim, end_dim, mode])

Flattens the input along a contiguous range of dimensions.

Unflatten(dim, unflattened_size[, mode])

Unflattens a dimension of the input over multiple dimensions.

torchadf.nn.modules.linear

Below is a list of linear layers in the package.

Identity(*args, **kwargs)

Identity Operator.

Linear(in_features, out_features[, bias, ...])

A dense (fully connected) linear layer.

torchadf.nn.modules.pooling

Below is a list of supported pooling layers in the package.

AvgPool1d(kernel_size[, stride, padding, ...])

A 1D average pooling layer.

AvgPool2d(kernel_size[, stride, padding, ...])

A 2D average pooling layer.

AvgPool3d(kernel_size[, stride, padding, ...])

A 3D average pooling layer.

torchadf.nn.functional

Below is a list of the functional counterparts to all supported layers in the package.

conv1d(in_mean, in_var, weight[, bias, ...])

Applies a convolution function for 1D inputs.

conv2d(in_mean, in_var, weight[, bias, ...])

Applies a convolution function for 2D inputs.

conv3d(in_mean, in_var, weight[, bias, ...])

Applies a convolution function for 3D inputs.

avg_pool1d(in_mean, in_var, kernel_size[, ...])

Applies an average pooling function for 1D inputs.

avg_pool2d(in_mean, in_var, kernel_size[, ...])

Applies an average pooling function for 2D inputs.

avg_pool3d(in_mean, in_var, kernel_size[, ...])

Applies an average pooling function for 3D inputs.

relu(in_mean, in_var[, mode])

Applies a rectified linear unit activation.

linear(in_mean, in_var, weight[, bias, mode])

Applies a dense (fully connected) linear transform.

flatten(in_mean, in_var, start_dim, end_dim)

Flattens the inputs along a contiguous range of dimensions.

unflatten(in_mean, in_var, dim, unflattened_size)

Unflattens a dimension of the inputs over multiple dimensions.