avalanche.training.ParametricBuffer
- class avalanche.training.ParametricBuffer(max_size: int, groupby=None, selection_strategy: ExemplarsSelectionStrategy | None = None)[source]
Stores samples for replay using a custom selection strategy and grouping.
- __init__(max_size: int, groupby=None, selection_strategy: ExemplarsSelectionStrategy | None = None)[source]
Init.
- Parameters:
max_size – The max capacity of the replay memory.
groupby – Grouping mechanism. One of {None, ‘class’, ‘task’, ‘experience’}.
selection_strategy – The strategy used to select exemplars to keep in memory when cutting it off.
Methods
__init__(max_size[, groupby, selection_strategy])Init.
get_group_lengths(num_groups)Compute groups lengths given the number of groups num_groups.
post_adapt(agent, exp)Update self.buffer using the agent state and current experience.
resize(strategy, new_size)Update the maximum size of the buffers.
update(strategy, **kwargs)Update self.buffer using the strategy state.
Attributes
bufferBuffer of samples.
buffer_datasetsReturn group buffers as a list of `AvalancheDataset`s.
buffer_groupsDictionary of buffers.
max_sizeMaximum size of the buffer.