Skip to main content

Module bce

Module bce 

Source
Expand description

Binary cross-entropy. Binary cross-entropy loss.

When logits = true the loss is computed in a numerically stable way from raw logits via [log_sigmoid]; otherwise the inputs are treated as probabilities and the logs are clamped to avoid −∞.

Structs§

BinaryCrossEntropyLoss
Calculate the binary cross entropy loss from the input logits and the targets.
BinaryCrossEntropyLossConfig
Configuration to create a BinaryCrossEntropyLoss using the BinaryCrossEntropyLossConfig::init.