avalanche.training.ParametricBuffer

class avalanche.training.ParametricBuffer(max_size: int, groupby=None, selection_strategy: Optional[avalanche.training.storage_policy.ExemplarsSelectionStrategy] = None)[source]

Stores samples for replay using a custom selection strategy and grouping.

__init__(max_size: int, groupby=None, selection_strategy: Optional[avalanche.training.storage_policy.ExemplarsSelectionStrategy] = None)[source]
Parameters
  • max_size – The max capacity of the replay memory.

  • groupby – Grouping mechanism. One of {None, ‘class’, ‘task’,

‘experience’}. :param selection_strategy: The strategy used to select exemplars to

keep in memory when cutting it off.

Methods

__init__(max_size[, groupby, selection_strategy])

param max_size

The max capacity of the replay memory.

get_group_lengths(num_groups)

Compute groups lengths given the number of groups num_groups.

resize(strategy, new_size)

Update the maximum size of the buffers.

update(strategy, **kwargs)

Update self.buffer_groups using the strategy state.

Attributes

buffer

Buffer of samples.

buffer_datasets

Return group buffers as a list of `AvalancheDataset`s. .