er#

This module implements the simplest form of rehearsal training: Experience Replay. It maintains a buffer of previously seen examples and uses them to augment the current batch during training.

Example usage:

model = Er(backbone, loss, args, transform) loss = model.observe(inputs, labels, not_aug_inputs, epoch)

Classes

class models.er.Er(backbone, loss, args, transform)[source]#

Bases: ContinualModel

COMPATIBILITY: List[str] = ['class-il', 'domain-il', 'task-il', 'general-continual']#
NAME: str = 'er'#
static get_parser()[source]#

Returns an ArgumentParser object with predefined arguments for the Er model.

Besides the required add_management_args and add_experiment_args, this model requires the add_rehearsal_args to include the buffer-related arguments.

Return type:

ArgumentParser

observe(inputs, labels, not_aug_inputs, epoch=None)[source]#

ER trains on the current task using the data provided, but also augments the batch with data from the buffer.