Shortcuts

CauchyLinear

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

Cauchy Distribution Linear Density Layer.

Parameters:
  • base_layer (type[nn.Module]) – The base layer class.

  • event_dim (int) – The number of event dimensions.

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

  • **layer_args – Additional arguments for the base layer.

Shape:
  • Input: \((\ast, H_{in})\) where \(\ast\) means any number of dimensions including none and \(H_{in} = \text{in_features}\).

  • Output: A dict with the following keys

    • "loc": The mean of the Cauchy distribution of shape \((\ast, H_{out})\) where all but the last dimension are the same as the input and \(H_{out} = \text{out_features}\).

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