StreamBuffer#
- class hybrid_aif.train.StreamBuffer[source]#
Bases:
ModuleA uniform replay buffer over a flat step stream. Device-side, a pytree.
Static shapes and traced counters like
StaticBuffer, butcapacitycounts steps:extend()splices each episode onto one ring in completion order, andsample_windows()drawsseq_lencontiguous steps starting anywhere, so a window may cross episode boundaries; itsis_firstcolumn marks the joins forobserve(). Nothing is padded or truncated; eviction is FIFO by step.Design: docs/design/amortization.md A12 chunk 2c §(d′)
- 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.
- property windows: int#
How many distinct
seq_len-step windows the live stream offers.size − seq_len + 1, floored at 0: one window per valid start offset.
- __init__(data, size, cursor, capacity, seq_len, schema=())#