evorl.recorders¶
Package Contents¶
Classes¶
Container for multiple recorders. |
|
Log file recorder. |
|
A Recorder Interface. |
|
Recorder for Weights & Biases. |
Functions¶
Add prefix to the keys of a dictionary. |
|
Get statistics of a 1D array. |
|
Get raw value and statistics of a 1D array. |
API¶
- class evorl.recorders.ChainRecorder(recorders: collections.abc.Sequence[evorl.recorders.recorder.Recorder])[source]¶
Bases:
evorl.recorders.recorder.RecorderContainer for multiple recorders.
- add_recorder(recorder: evorl.recorders.recorder.Recorder) None[source]¶
- class evorl.recorders.LogRecorder(log_path: str, console: bool = True)[source]¶
Bases:
evorl.recorders.recorder.RecorderLog file recorder.
- class evorl.recorders.WandbRecorder(*, project, name, config, tags, path, **wandb_kwargs)[source]¶
Bases:
evorl.recorders.recorder.RecorderRecorder for Weights & Biases.
- evorl.recorders.add_prefix(data: dict, prefix: str)[source]¶
Add prefix to the keys of a dictionary.
- evorl.recorders.get_1d_array(data)[source]¶
Get statistics of a 1D array.
Similar to
get_1d_array_statistics, but instead of recording histogram, WandB will record the raw data.
- evorl.recorders.get_1d_array_statistics(data, histogram=False)[source]¶
Get raw value and statistics of a 1D array.
Helper function for logging in WandB.
- Parameters:
data – 1D numpy array. If data has multiple dimensions, it will be viewed as flattened.
histogram – If True, return raw data in
pd.Series, which will be futher converted to histogram inWandBRecorder.
- Returns:
A dictionary containing min, max, mean, and optional raw data.