Skip to main content

Module cross_entropy

Module cross_entropy 

Source
Expand description

Cross-entropy (multi-class). Cross-entropy loss accepting floating-point target distributions.

A lighter variant of [burn::nn::loss::CrossEntropyLoss]: it takes soft float targets (one-hot, soft labels, or raw logits) rather than integer class indices, and drops padding/weights/label-smoothing. output_logits and target_logits control whether each side is normalised (log-softmax / softmax) before the loss.

Structsยง

CrossEntropyLoss
Calculate the cross-entropy loss from the output logits and the targets.
CrossEntropyLossConfig
Configuration to create a CrossEntropyLoss using the CrossEntropyLossConfig::init.