avalanche.logging.WandBLogger

class avalanche.logging.WandBLogger(project_name: str = 'Avalanche', run_name: str = 'Test', log_artifacts: bool = False, path: Union[str, pathlib.Path] = 'Checkpoints', uri: Optional[str] = None, sync_tfboard: bool = False, save_code: bool = True, config: Optional[object] = None, dir: Optional[Union[str, pathlib.Path]] = None, params: Optional[dict] = None)[source]

The WandBLogger provides an easy integration with Weights & Biases logging. Each monitored metric is automatically logged to a dedicated Weights & Biases project dashboard.

External storage for W&B Artifacts (for instance - AWS S3 and GCS buckets) uri are supported.

The wandb log files are placed by default in “./wandb/” unless specified.

Note

TensorBoard can be synced on to the W&B dedicated dashboard.

__init__(project_name: str = 'Avalanche', run_name: str = 'Test', log_artifacts: bool = False, path: Union[str, pathlib.Path] = 'Checkpoints', uri: Optional[str] = None, sync_tfboard: bool = False, save_code: bool = True, config: Optional[object] = None, dir: Optional[Union[str, pathlib.Path]] = None, params: Optional[dict] = None)[source]

Creates an instance of the WandBLogger. :param project_name: Name of the W&B project. :param run_name: Name of the W&B run. :param log_artifacts: Option to log model weights as W&B Artifacts. :param path: Path to locally save the model checkpoints. :param uri: URI identifier for external storage buckets (GCS, S3). :param sync_tfboard: Syncs TensorBoard to the W&B dashboard UI. :param save_code: Saves the main training script to W&B. :param config: Syncs hyper-parameters and config values used to W&B. :param dir: Path to the local log directory for W&B logs to be saved at. :param params: All arguments for wandb.init() function call.

Visit https://docs.wandb.ai/ref/python/init to learn about all wand.init() parameters.

Methods

__init__([project_name, run_name, ...])

Creates an instance of the WandBLogger. :param project_name: Name of the W&B project. :param run_name: Name of the W&B run. :param log_artifacts: Option to log model weights as W&B Artifacts. :param path: Path to locally save the model checkpoints. :param uri: URI identifier for external storage buckets (GCS, S3). :param sync_tfboard: Syncs TensorBoard to the W&B dashboard UI. :param save_code: Saves the main training script to W&B. :param config: Syncs hyper-parameters and config values used to W&B. :param dir: Path to the local log directory for W&B logs to be saved at. :param params: All arguments for wandb.init() function call. Visit https://docs.wandb.ai/ref/python/init to learn about all wand.init() parameters.

after_backward(strategy, metric_values, **kwargs)

Called after criterion.backward() by the BaseStrategy.

after_eval(strategy, metric_values, **kwargs)

Called after eval by the BaseStrategy.

after_eval_dataset_adaptation(strategy, ...)

Called after eval_dataset_adaptation by the BaseStrategy.

after_eval_exp(strategy, metric_values, **kwargs)

Called after eval_exp by the BaseStrategy.

after_eval_forward(strategy, metric_values, ...)

Called after model.forward() by the BaseStrategy.

after_eval_iteration(strategy, ...)

Called after the end of an iteration by the BaseStrategy.

after_forward(strategy, metric_values, **kwargs)

Called after model.forward() by the BaseStrategy.

after_train_dataset_adaptation(strategy, ...)

Called after train_dataset_adapatation by the BaseStrategy.

after_training(strategy, metric_values, **kwargs)

Called after train by the BaseStrategy.

after_training_epoch(strategy, ...)

Called after train_epoch by the BaseStrategy.

after_training_exp(strategy, metric_values, ...)

Called after train_exp by the BaseStrategy.

after_training_iteration(strategy, ...)

Called after the end of a training iteration by the BaseStrategy.

after_update(strategy, metric_values, **kwargs)

Called after optimizer.update() by the BaseStrategy.

args_parse()

before_backward(strategy, metric_values, ...)

Called before criterion.backward() by the BaseStrategy.

before_eval(strategy, metric_values, **kwargs)

Called before eval by the BaseStrategy.

before_eval_dataset_adaptation(*args, **kwargs)

Called before eval_dataset_adaptation by the BaseStrategy.

before_eval_exp(strategy, metric_values, ...)

Called before eval_exp by the BaseStrategy.

before_eval_forward(strategy, metric_values, ...)

Called before model.forward() by the BaseStrategy.

before_eval_iteration(strategy, ...)

Called before the start of a training iteration by the BaseStrategy.

before_forward(strategy, metric_values, **kwargs)

Called before model.forward() by the BaseStrategy.

before_run()

before_train_dataset_adaptation(*args, **kwargs)

Called before train_dataset_adapatation by the BaseStrategy.

before_training(strategy, metric_values, ...)

Called before train by the BaseStrategy.

before_training_epoch(strategy, ...)

Called before train_epoch by the BaseStrategy.

before_training_exp(strategy, metric_values, ...)

Called before train_exp by the BaseStrategy.

before_training_iteration(strategy, ...)

Called before the start of a training iteration by the BaseStrategy.

before_update(strategy, metric_values, **kwargs)

Called before optimizer.update() by the BaseStrategy.

import_wandb()

log_metric(metric_value, callback)

This method will be invoked on each callback.

log_single_metric(name, value, x_plot)

This abstract method will have to be implemented by each subclass.