helios.core.loggers.wandb¶
Classes¶
Arguments for constructing a |
|
Wrapper for the Weights & Biases |
Module Contents¶
- class helios.core.loggers.wandb.WandbArgs[source]¶
Bases:
TypedDictArguments for constructing a
WandbWriter.projectis the only required key; all others are optional.- Parameters:
project – W&B project name.
name – display name for the run shown in the W&B UI. If not provided, defaults to
run_nameprovided bysetup().config – hyper-parameter dictionary to associate with the run.
extra_args – additional keyword arguments forwarded verbatim to
wandb.init().
- project: Required[str]¶
- name: str¶
- class helios.core.loggers.wandb.WandbWriter(project: str, name: str | None = None, config: dict[str, Any] | None = None, extra_args: dict[str, Any] | None = None)[source]¶
Bases:
helios.core.loggers.base.LoggerWrapper for the Weights & Biases
wandb.initrun.Data for the logger will be placed under
log_root/wandb. When resuming, the original run ID is restored and new data is appended to it.Requires the
wandbpackage. Install it with:pip install wandb
- Parameters:
project – W&B project name.
name – (optional) display name for the run.
config – (optional) hyper-parameter configuration dictionary to associate with the run.
extra_args – (optional) extra keyword arguments forwarded verbatim to
wandb.init(). Defaults to{}.
- setup(run_name: str, log_root: pathlib.Path | None, is_resume: bool) None[source]¶
Finish configuring the
WandbWriter.In particular, this function will call
wandb.init(). If a run ID was previously saved, then it will be forwarded to W&B so the run continues in place. In distributed training, the writer will only be created on rank 0.- Parameters:
run_name – the name of the current run; used as the W&B run name when no explicit
namewas given in__init__.log_root – root directory for logs. W&B data will be written under
log_root/wandb/.Nonelets W&B choose its own default directory.is_resume –
Truewhen continuing a previous run.
- state_dict() dict[str, Any][source]¶
Return a dictionary containing the writer state.
The state will be saved under a key called
"run_id"holding the current run ID. If W&B was disabled, thenNoneis stored.- Returns:
A dictionary with the logger state.
- load_state_dict(state_dict: dict[str, Any]) None[source]¶
Restore the writer state from a previously saved dictionary.
- Parameters:
state_dict – the state dictionary returned by
state_dict().