StaticBuffer#
- class hybrid_aif.train.StaticBuffer[source]#
Bases:
ModuleA uniform replay buffer of fixed-length episode-aligned sequences. A pytree.
One JAX array per column, written FIFO into a ring.
sizeandcursorare traced scalars, soadd()andsample()are pure and the buffer can ride alax.scancarry.- schema: tuple[tuple[str, ColumnSpec], ...] = ()#
The task’s own columns,
(name, ColumnSpec)pairs.
- property pad_rules: dict[str, str]#
How
fit_length()pads each task column, from the schema.
- classmethod empty(capacity, seq_len, obs_dim, action_dim, extras=None)[source]#
An allocated, empty buffer. Shapes are fixed here and never change.
extrasdeclares the task’s columns (ColumnSpecper name); every episode written must carry exactly those.
- ready(batch_size)[source]#
Whether a full batch can be drawn without repeating the whole buffer. Host-side.
- __init__(data, size, cursor, capacity, seq_len, schema=())#