Training🔗
callcut.training provides PyTorch Lightning infrastructure for training call
detection models. It includes Lightning modules, data modules, loss functions,
and callbacks.
Lightning Modules🔗
The CallDetectorModule wraps any
BaseDetector model for training with PyTorch Lightning. It
handles the training loop, validation metrics, and optimizer configuration.
The CallDataModule handles data loading, train/val/test
splitting (balanced by window count), and DataLoader creation.
|
Lightning Module wrapping a call detector for training. |
|
Lightning DataModule for call detection. |
Loss Functions🔗
Loss functions for training call detection models. All loss functions inherit from
BaseLoss and expect logits (raw model output before
sigmoid) and binary target labels.
|
Abstract base class for training loss functions. |
|
Binary cross-entropy loss with logits. |
|
Focal loss for handling class imbalance. |
|
Dice loss for optimizing overlap directly. |
|
Tversky loss with adjustable false positive/negative penalties. |
Callbacks🔗
Custom Lightning callbacks for training.
Callback that logs training progress using the callcut logger. |
|
Callback that records training metrics history. |
|
|
Callback that saves the best model weights during training. |