How-To Guides¶
How-to guides are goal-oriented recipes. Each one solves a specific task and assumes you already know the basics from the Getting Started tutorial.
Available guides¶
- Use Focal Loss:
SigmoidFocalLossfor binary/multi-label,SoftmaxFocalLossfor multiclass, withalpha,gamma, andmean_positivereduction - Use Ranking Losses:
SmoothAPLoss,RecallAtQuantileLoss, andPAUCAtBudgetLosswith queue sizing, band selection, and temperature guidance - Weight Samples by Value:
sample_weightfor value-weighted objectives (e.g. dollar-weighted recall@budget) across every loss - 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