Binary Cross-Entropy with Logits
The stable loss for two-class problems.
Two Classes, One Decision
When your model answers a yes or no question like spam or not spam, you reach for binary cross-entropy, the loss built for two-class problems. ✅
From Score to Probability
A model first outputs a raw score called a logit. The sigmoid function squashes that logit into a probability between 0 and 1.
import torch
prob = torch.sigmoid(logit)All lessons in this course
- MSE & MAE for Regression
- Binary Cross-Entropy with Logits
- Cross-Entropy for Multiclass
- Class Weights for Imbalanced Data