evorl.recorders.wandb_recorder

Module Contents

Classes

WandbRecorder

Recorder for Weights & Biases.

Functions

add_prefix

Add prefix to the keys of a dictionary.

get_1d_array

Get statistics of a 1D array.

get_1d_array_statistics

Get raw value and statistics of a 1D array.

API

class evorl.recorders.wandb_recorder.WandbRecorder(*, project, name, config, tags, path, **wandb_kwargs)[source]

Bases: evorl.recorders.recorder.Recorder

Recorder for Weights & Biases.

close()[source]
init() None[source]
write(data: collections.abc.Mapping[str, Any], step: int | None = None) None[source]
evorl.recorders.wandb_recorder.add_prefix(data: dict, prefix: str)[source]

Add prefix to the keys of a dictionary.

evorl.recorders.wandb_recorder.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.wandb_recorder.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 in WandBRecorder.

Returns:

A dictionary containing min, max, mean, and optional raw data.