LAYERS#

Classes#

class backbone.utils.layers.ClipLinear(in_features, out_features, lora_dropout=0.0, fan_in_fan_out=False, **kwargs)[source]#

Bases: Linear, LoRALayer

forward(x, AB=None)[source]#
reset_parameters()[source]#
class backbone.utils.layers.IncrementalClassifier(embed_dim, nb_classes)[source]#

Bases: Module

forward(x)[source]#

Forward pass.

Compute the logits for each head and concatenate them.

Parameters:

x (Tensor) – torch.Tensor, input features.

update(nb_classes, freeze_old=True)[source]#

Add a new head to the classifier.

Parameters:
  • nb_classes (int) –

  • add. (number of classes to) –

  • freeze_old – bool, whether to freeze the old heads.