Module buffer

Module buffer 

Source
Expand description

Experience replay buffers for reinforcement learning.

This module provides several buffer implementations, each suited to different training scenarios:

BufferUse case
ringbuf::ReplayBufferStandard uniform off-policy replay (DQN, SAC).
priority::PrioritizedReplayBufferProportional PER with importance-sampling weights.
sequence::SequenceReplayBufferContiguous subsequence sampling for recurrent policies.
her::HERBufferHindsight Experience Replay for goal-conditioned RL.
mmap::MmapReplayBufferDisk-backed spill for large replay capacities.
columnar::ExperienceTableAppend-only on-policy table (PPO, A2C).
offline::OfflineDatasetBufferRead-only offline RL datasets.
concurrent::ConcurrentReplayBufferLock-free multi-producer buffer.

All buffers store observations and actions as f32, rewards as f32, and boolean done flags. The ExperienceRecord struct is a convenience for the push() API; prefer push_slices() to avoid intermediate Vec allocations in hot paths.

Modules§

columnar
concurrent
episode
Episode boundary tracking for ring buffers.
extra_columns
her
Hindsight Experience Replay (HER) buffer.
mixed
Mixed sampling from two replay buffers.
mmap
offline
Read-only offline dataset buffer for offline RL algorithms.
priority
Sum-tree backed prioritized experience replay.
provenance
ringbuf
sequence
Sequence replay buffer for recurrent/transformer-based RL algorithms.
varlen

Structs§

ExperienceRecord
A single experience record to push into a buffer. Uses f32 throughout for numpy compatibility.