avalanche.evaluation.metrics.ImagesSamplePlugin

class avalanche.evaluation.metrics.ImagesSamplePlugin(*, mode: Literal['train', 'eval', 'both'], n_cols: int, n_rows: int, group: bool = True, disable_augmentations: bool = True)[source]

Metric used to sample random images.

Only images in strategy.adapted dataset are used. Images added in the dataloader (like the replay plugins do) are missed. By default data augmentation are removed.

Parameters:
  • n_rows – The numbers of raws to use in the grid of images.

  • n_cols – The numbers of columns to use in the grid of images.

  • group – If True, images will be grouped by (task, label)

  • mode – The plugin can be used at train or eval time.

  • disable_augmentations – determines whether to show the augmented images or the raw images (default: True).

Returns:

The corresponding plugins.

__init__(*, mode: Literal['train', 'eval', 'both'], n_cols: int, n_rows: int, group: bool = True, disable_augmentations: bool = True)[source]

Creates an instance of a plugin metric.

Child classes can safely invoke this (super) constructor as the first experience.

Methods

__init__(*, mode, n_cols, n_rows[, group, ...])

Creates an instance of a plugin metric.

after_backward(strategy)

after_eval(strategy)

after_eval_dataset_adaptation(strategy)

after_eval_exp(strategy)

after_eval_forward(strategy)

after_eval_iteration(strategy)

after_forward(strategy)

after_train_dataset_adaptation(strategy)

after_training(strategy)

after_training_epoch(strategy)

after_training_exp(strategy)

after_training_iteration(strategy)

after_update(strategy)

before_backward(strategy)

before_eval(strategy)

before_eval_dataset_adaptation(strategy)

before_eval_exp(strategy)

before_eval_forward(strategy)

before_eval_iteration(strategy)

before_forward(strategy)

before_train_dataset_adaptation(strategy)

before_training(strategy)

before_training_epoch(strategy)

before_training_exp(strategy)

before_training_iteration(strategy)

before_update(strategy)

reset()

Resets the metric internal state.

result()

Obtains the value of the metric.