Shortcuts

CauchyConvNd

class torch_uncertainty.layers.distributions.CauchyConvNd(base_layer, event_dim, min_scale=1e-06, **layer_args)[source]

Cauchy Distribution Convolutional Density Layer.

Parameters:
  • in_channels (int) – The number of input channels.

  • out_channels (int) – The number of event channels.

  • kernel_size (int | tuple[int]) – The size of the convolutional kernel.

  • stride (int | tuple[int]) – The stride of the convolution.

  • padding (int | tuple[int]) – The padding of the convolution.

  • dilation (int | tuple[int]) – The dilation of the convolution.

  • groups (int) – The number of groups in the convolution.

  • min_scale (float) – The minimal value of the scale parameter.

  • device (torch.device) – The device where the layer is stored.

  • dtype (torch.dtype) – The datatype of the layer.

Shape:
  • Input: \((N, C_{in}, \ast)\) where \(\ast\) means any number of dimensions and \(C_{in} = \text{in_channels}\) and \(N\) is the batch size.

  • Output: A dict with the following keys

    • "loc": The mean of the Cauchy distribution of shape \((N, C_{out}, \ast)\) where \(C_{out} = \text{out_channels}\).

    • "scale": The standard deviation of the Cauchy distribution of shape \((\ast, C_{out}, \ast)\).