g_vbll_loss¶
- probly.losses.torch.g_vbll_loss(layer: GVBLLLayer, features: Tensor, targets: Tensor, regularization_weight: float) Tensor[source]¶
Negative generative VBLL ELBO from [HWS24].
Implements the discriminative-free generative training objective of a
GVBLLLayer: the Jensen lower bound on the expected class-conditional log-likelihood, plus the class-mean KL term and a Wishart term on the shared noise precision.- Parameters:
layer – The generative variational Bayesian last layer to fit.
features – Backbone features feeding the layer, shape
(batch, in_features).targets – Integer class labels, shape
(batch,).regularization_weight – Weight on the regularization terms (typically
1 / dataset_size).
- Returns:
A scalar tensor with the negative ELBO to minimize.