ISubGVQA.training.val_epoch

Functions

validate_epoch(→ tuple)

Validates the model for one epoch on the validation dataset.

Module Contents

ISubGVQA.training.val_epoch.validate_epoch(val_loader: torch.nn.Module, model: torch.nn.Module, criterion: torch.optim.Optimizer, args: argparse.Namespace, epoch: int) tuple

Validates the model for one epoch on the validation dataset.

Args:

val_loader (torch.nn.Module): DataLoader for the validation dataset. model (torch.nn.Module): The model to be validated. criterion (torch.optim.Optimizer): Loss function(s) used for validation. args (argparse.Namespace): Command line arguments containing various settings. epoch (int): The current epoch number.

Returns:

tuple: A tuple containing the average short answer accuracy and the average loss.