- class avalanche.training.ExperienceBalancedBuffer(max_size: int, adaptive_size: bool = True, num_experiences=None)[source]
Rehearsal buffer with samples balanced over experiences.
The number of experiences can be fixed up front or adaptive, based on the ‘adaptive_size’ attribute. When adaptive, the memory is equally divided over all the unique observed experiences so far.
- __init__(max_size: int, adaptive_size: bool = True, num_experiences=None)[source]
max_size – max number of total input samples in the replay memory.
adaptive_size – True if mem_size is divided equally over all observed experiences (keys in replay_mem).
num_experiences – If adaptive size is False, the fixed number of experiences to divide capacity over.
__init__(max_size[, adaptive_size, ...])
- param max_size
max number of total input samples in the replay
Compute groups lengths given the number of groups num_groups.
Update the maximum size of the buffers.
Update self.buffer_groups using the strategy state.
Buffer of samples.
Return group buffers as a list of `AvalancheDataset`s.