Softmax turns raw scores (logits) into probabilities that sum to 1; cross-entropy measures how much probability the model gave to the correct class: loss = negative log of the predicted probability of the true class.
It penalizes confident wrong predictions heavily and gives strong gradients when the model is wrong.
Combined, the gradient with respect to the logits simplifies to predicted probability minus the one-hot label, which is simple and numerically stable.
Use binary cross-entropy with sigmoid for two classes or multi-label tasks. In practice use the fused "with logits" loss functions rather than applying softmax yourself.
Loading…