ER#

Arguments#

Rehearsal arguments

Arguments shared by all rehearsal-based methods.

--buffer_sizeint

Help: The size of the memory buffer.

  • Default: None

--minibatch_sizeint

Help: The batch size of the memory buffer.

  • Default: None

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, dataset) loss = model.observe(inputs, labels, not_aug_inputs, epoch)

Classes#

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

Bases: ContinualModel

Continual learning via Experience Replay.

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

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

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.