ICARL CASPER#
Arguments#
Options
- --casper_batchint
Help: Size of minibatch for casper. Equal to batch_size by default, if negative equal to buffer_size.
Default:
None
- --rhofloat
Help: Weight for casper loss.
Default:
0.01
- --knn_laplaceint
Help: K of knn to build the graph for laplacian.
Default:
10
- --pint
Help: Number of classes to be drawn from the buffer. Default is N_CLASSES_PER_TASK.
Default:
None
Rehearsal arguments
Arguments shared by all rehearsal-based methods.
- --buffer_sizeint
Help: The size of the memory buffer.
Default:
None
- --minibatch_sizeint
Help: The batch size of the memory buffer.
Default:
None
Classes#
- class models.icarl_casper.ICarlCasper(backbone, loss, args, transform, dataset=None)[source]#
Bases:
CasperModel
Continual Learning via iCaRL. Treated with CaSpeR!
- get_loss(inputs, labels, task_idx, logits)[source]#
Computes the loss tensor.
- Parameters:
inputs (Tensor) – the images to be fed to the network
labels (Tensor) – the ground-truth labels
task_idx (int) – the task index
logits (Tensor) – the logits of the old network
- Returns:
the differentiable loss value
- Return type:
Tensor