Experience Buffer

class rlforge.utils.ExperienceBuffer(size, mini_batch_size)

A fixed-size replay buffer for storing agent experiences.

The buffer stores transitions of the form (state, action, reward, terminal, new_state). When the buffer reaches its maximum capacity, the oldest experience is discarded to make room for new ones. This structure is commonly used in reinforcement learning to break correlations between consecutive samples and stabilize training.

Parameters

sizeint

Maximum number of experiences to store in the buffer.

mini_batch_sizeint

Number of experiences to sample when calling sample.

Attributes

bufferlist

Internal list storing the experiences.

sizeint

Maximum capacity of the buffer.

mini_batch_sizeint

Number of samples returned by sample.