Shortcuts

NormalInverseGammaLinear

class torch_uncertainty.layers.distributions.NormalInverseGammaLinear(base_layer, event_dim, min_lmbda=1e-06, min_alpha=1e-06, min_beta=1e-06, **layer_args)[source]

Normal-Inverse-Gamma Distribution Linear Density Layer.

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

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

  • min_lmbda (float) – The minimal value of the \(\lambda\) parameter.

  • min_alpha (float) – The minimal value of the \(\alpha\) parameter.

  • min_beta (float) – The minimal value of the \(\beta\) 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 Normal-Inverse-Gamma distribution of shape \((\ast, H_{out})\) where all but the last dimension are the same as the input and \(H_{out} = \text{out_features}\).

    • "lmbda": The lambda parameter of the Normal-Inverse-Gamma distribution of shape \((\ast, H_{out})\).

    • "alpha": The alpha parameter of the Normal-Inverse-Gamma distribution of shape \((\ast, H_{out})\).

    • "beta": The beta parameter of the Normal-Inverse-Gamma distribution of shape \((\ast, H_{out})\).

Source: