Skip to content
← All tracks

Loss Functions

PyTorch

The training objectives that shape every model — regression, classification, distribution-matching, and contrastive.

0 / 8 solved
  1. 1. Not solved yet. Implement Mean Squared Error
  2. 2. Not solved yet. Implement Binary Cross-Entropy Loss
  3. 3. Not solved yet. Implement Cross-Entropy Loss
  4. 4. Not solved yet. Implement KL Divergence
  5. 5. Not solved yet. Label Smoothing
  6. 6. Not solved yet. Focal Loss
  7. 7. Not solved yet. Triplet Loss
  8. 8. Not solved yet. Contrastive Loss (InfoNCE)

Check yourself

4 questions · one attempt each

These do not count toward finishing the track. They are here to catch the things that are easy to read past.

0 / 4

Focal loss multiplies cross-entropy by (1 - p_t) ** gamma. What does that achieve?

loss = -(1 - p_t) ** gamma * log(p_t)
Question 1 of 4