elbo_loss

probly.losses.torch.elbo_loss(inputs: Tensor, targets: Tensor, kl: Tensor, *, kl_penalty: float = 1e-05) Tensor[source]

Evidence lower bound loss based on [BCKW15].

Parameters:
  • inputs – Logits of size (n_instances, n_classes).

  • targets – Class labels of size (n_instances,).

  • kl – KL divergence of the model.

  • kl_penalty – Weight for KL divergence term.

Returns:

The mean loss value.

Examples using probly.losses.torch.elbo_loss

Credal BNN Visualization

Credal BNN Visualization

Credal BNN on MNIST

Credal BNN on MNIST

Bayesian Neural Network on Two Moons

Bayesian Neural Network on Two Moons

Bayesian Ensemble on Two Moons

Bayesian Ensemble on Two Moons

Bayesian Ensemble on MNIST

Bayesian Ensemble on MNIST

Bayesian Neural Network on MNIST

Bayesian Neural Network on MNIST