Recording Buffers
Game-state recording buffers for debugging and analysis.
- class BaseRecordBuffer
Bases:
objectFor type-checking.
- frames: ndarray | DummyArray
- features: ndarray | DummyArray
- rewards: ndarray | DummyArray
- actions: ndarray | DummyArray
- class RecordBuffer(res: tuple[int, int] = (240, 320), ch_num: int = 3, size: int = 40000, dtypes: list[dtype] | None = None)
Bases:
objectStore game frames and associated scalars in a fixed-size circular buffer.
A class for recording game states.
- Parameters:
res (tuple[int, int], optional) – resolution in form of (height, width). Defaults to (240, 320).
ch_num (int) – number of colour channels. Defaults to 3.
size (int) – maximum size, starts deleting old memories after maximum reached. Defaults to 40000.
dtypes (list[object]) – data type of frame, reward and (if any) features, datatype for features
[np.uint8 (should be passed in as strings like "np.uint8" or "bool". Defaults to)
np.float32].
- class FramelessRecordBuffer(*args, **kwargs)
Bases:
BaseRecordBufferA dummy RecordBuffer that does not record actual game frames.
Wrap a
RecordBufferthat stores rewards and actions only.- Parameters:
*args – Positional arguments forwarded to
RecordBuffer.**kwargs – Keyword arguments forwarded to
RecordBuffer`.resandch_numare ignored because frames are not stored.
- class DummyRecordBuffer
Bases:
BaseRecordBufferA dummy RecordBuffer that does not record anything.
Initialize counters and dummy array placeholders.
Classes
|
Store game frames and associated scalars in a fixed-size circular buffer. |
|
A dummy RecordBuffer that does not record actual game frames. |
A dummy RecordBuffer that does not record anything. |
|
For type-checking. |
Implementation modules
Circular buffer for frames, rewards, actions, and optional features.
- class RecordBuffer(res: tuple[int, int] = (240, 320), ch_num: int = 3, size: int = 40000, dtypes: list[dtype] | None = None)
Bases:
objectStore game frames and associated scalars in a fixed-size circular buffer.
A class for recording game states.
- Parameters:
res (tuple[int, int], optional) – resolution in form of (height, width). Defaults to (240, 320).
ch_num (int) – number of colour channels. Defaults to 3.
size (int) – maximum size, starts deleting old memories after maximum reached. Defaults to 40000.
dtypes (list[object]) – data type of frame, reward and (if any) features, datatype for features
[np.uint8 (should be passed in as strings like "np.uint8" or "bool". Defaults to)
np.float32].
No-op record buffers that skip or minimize frame storage.
- class DummyRecordBuffer
Bases:
BaseRecordBufferA dummy RecordBuffer that does not record anything.
Initialize counters and dummy array placeholders.
- class FramelessRecordBuffer(*args, **kwargs)
Bases:
BaseRecordBufferA dummy RecordBuffer that does not record actual game frames.
Wrap a
RecordBufferthat stores rewards and actions only.- Parameters:
*args – Positional arguments forwarded to
RecordBuffer.**kwargs – Keyword arguments forwarded to
RecordBuffer`.resandch_numare ignored because frames are not stored.
Base types for record buffers and no-op array stubs.