lucir#

Classes

class models.lucir.CustomClassifier(in_features, cpt, n_tasks)[source]#

Bases: Module

forward(x)[source]#
noscale_forward(x)[source]#
reset_parameters()[source]#
reset_weight(i)[source]#
class models.lucir.Lucir(backbone, loss, args, transform)[source]#

Bases: ContinualModel

COMPATIBILITY: List[str] = ['class-il', 'task-il']#
NAME: str = 'lucir'#
begin_task(dataset)[source]#
end_task(dataset)[source]#
fit_buffer(opt_steps)[source]#
forward(x)[source]#
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

static get_parser()[source]#
Return type:

ArgumentParser

imprint_weights(dataset)[source]#
observe(inputs, labels, not_aug_inputs, logits=None, epoch=None, fitting=False)[source]#
update_classifier()[source]#

Functions

models.lucir.lucir_batch_hard_triplet_loss(labels, embeddings, k, margin, num_old_classes)[source]#

LUCIR triplet loss.