credit.trainers.trainer_downscaling#
Attributes#
Classes#
Helper class that provides a standard way to create an ABC using |
Module Contents#
- credit.trainers.trainer_downscaling.logger#
- class credit.trainers.trainer_downscaling.TrainerDownscaling(model: torch.nn.Module, rank: int, conf: dict)#
Bases:
credit.trainers.base_trainer.BaseTrainerHelper class that provides a standard way to create an ABC using inheritance.
- setup(conf)#
- train_one_epoch(epoch, conf, trainloader, optimizer, criterion, scaler, scheduler, metrics)#
- validate(epoch, valid_loader, criterion, metrics)#
Validates the model on the validation dataset.
- Parameters:
epoch (int) – Current epoch number.
conf (dict) – Configuration dictionary containing validation settings.
valid_loader (DataLoader) – DataLoader for the validation dataset.
criterion (callable) – Loss function used for validation.
metrics (callable) – Function to compute metrics for evaluation.
- Returns:
Dictionary containing validation metrics and loss for the epoch.
- Return type:
dict