InputVisualizationCallback
InputVisualizationCallback
Bases: AlgoCallback
Visualizes random samples from each task and uses the loggers to save the plots.
Source code in sequel/utils/callbacks/input_visualization_callback.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
__init__(samples_per_task=5)
Inits the InputVisualizationCallback.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
samples_per_task |
int
|
number of samples to be saved for each tasks. Defaults to 5. |
5
|
Source code in sequel/utils/callbacks/input_visualization_callback.py
16 17 18 19 20 21 22 23 |
|
on_before_fit(algo, *args, **kwargs)
Retrieves and diplays in a single plot the input images from all tasks of the benchmark that the algorithm has been initialized with. The final plot is saved via the loggers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
algo |
BaseAlgorithm
|
The BaseAlgorithm instance. |
required |
Source code in sequel/utils/callbacks/input_visualization_callback.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
select_random_samples(dataset)
Selects a prefefined number of samples per each CL dataset. Each task corresponds to a different dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset |
torch.data.utils.Dataset
|
The PyTorch Datatet. |
required |
Returns:
Type | Description |
---|---|
List[torch.Tensor]
|
List[torch.Tensor]: The Tensors corresponding to the selected input samples. |
Source code in sequel/utils/callbacks/input_visualization_callback.py
25 26 27 28 29 30 31 32 33 34 35 36 |
|