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 λ parameter.

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

  • min_beta (float) – The minimal value of the β parameter.

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

Shape:
  • Input: (,Hin) where means any number of dimensions including none and Hin=in_features.

  • Output: A dict with the following keys

    • "loc": The mean of the Normal-Inverse-Gamma distribution of shape (,Hout) where all but the last dimension are the same as the input and Hout=out_features.

    • "lmbda": The lambda parameter of the Normal-Inverse-Gamma distribution of shape (,Hout).

    • "alpha": The alpha parameter of the Normal-Inverse-Gamma distribution of shape (,Hout).

    • "beta": The beta parameter of the Normal-Inverse-Gamma distribution of shape (,Hout).

Source: