training#
Functions
- utils.training.evaluate(model, dataset, last=False)[source]#
Evaluates the accuracy of the model for each past task.
The accuracy is evaluated for all the tasks up to the current one, only for the total number of classes seen so far.
- Parameters:
model (ContinualModel) – the model to be evaluated
dataset (ContinualDataset) – the continual dataset at hand
- Returns:
a tuple of lists, containing the class-il and task-il accuracy for each task
- Return type:
- utils.training.initialize_wandb(args)[source]#
Initializes wandb, if installed.
- Parameters:
args (Namespace) – the arguments of the current execution
- utils.training.mask_classes(outputs, dataset, k)[source]#
Given the output tensor, the dataset at hand and the current task, masks the former by setting the responses for the other tasks at -inf. It is used to obtain the results for the task-il setting.
- Parameters:
outputs (Tensor) – the output tensor
dataset (ContinualDataset) – the continual dataset
k (int) – the task index
- utils.training.train(model, dataset, args)[source]#
The training process, including evaluations and loggers.
- Parameters:
model (ContinualModel) – the module to be trained
dataset (ContinualDataset) – the continual dataset at hand
args (Namespace) – the arguments of the current execution