neodroidvision.classification.loss_functions.confidence_loss

A collection of loss functions for pytorch and torchvision

Classes

ConfidenceLoss([hint_budget, lmbda])

An almost copy paste of https://github.com/aivclab/confidence_classification_loss_pytorch The function uses the nn.Module internal state "training" to determine when to update lambda. You must call .eval() and .train() yourself Implements "Learning Confidence for Out-of-Distribution Detection in Neural Networks" https://arxiv.org/pdf/1802.04865.pdf A Softmax-cross-entropy classification loss, which provides an additional "confidence" output, which signals whether the softmax output is confident.