Skip to content

How-To Guides

How-to guides are goal-oriented recipes. Each one solves a specific task — assume you already know the basics from the Getting Started tutorial.

Available guides

  • Use Focal LossSigmoidFocalLoss for binary/multi-label, SoftmaxFocalLoss for multiclass, with alpha, gamma, and mean_positive reduction
  • Use Ranking LossesSmoothAPLoss, RecallAtQuantileLoss, and PAUCAtBudgetLoss with queue sizing, band selection, and temperature guidance
  • Configure Warmup and Blending — tune phase schedules, blend epochs, and temperature decay in LossWarmupWrapper
  • Train with DDP — multi-GPU all-gather setup for all losses
  • Log Per-Class Metrics — retrieve per-class loss tensors without a second forward pass
  • Migrate from BCE / CrossEntropyLoss — drop-in migration checklist, common mistakes, and a decision table for choosing the right loss