LUCIR#
Arguments#
Options
- --lamda_basefloat
Help: Regularization weight for embedding cosine similarity.
Default:
5.0
- --lamda_mrfloat
Help: Regularization weight for embedding cosine similarity.
Default:
1.0
- --k_mrint
Help: K for margin-ranking loss.
Default:
2
- --mr_marginfloat
Help: Margin for margin-ranking loss.
Default:
0.5
- --fitting_epochsint
Help: Number of epochs to finetune on coreset after each task.
Default:
20
- --lr_finetunefloat
Help: Learning Rate for finetuning.
Default:
0.01
- --imprint_weights0|1|True|False -> bool
Help: Apply weight imprinting?
Default:
1
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.lucir.Lucir(backbone, loss, args, transform, dataset=None)[source]#
Bases:
ContinualModel
Continual Learning via Lucir.
- get_loss(inputs, labels, task_idx)[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
- Returns:
the differentiable loss value
- Return type:
Tensor