RANPAC#

Arguments#

Options

--rp_sizeint

Help: size of the random projection layer (L in the paper)

  • Default: 10000

Slow Learner with Classifier Alignment.

Note

SLCA USES A CUSTOM BACKBONE (see feature_extractor_type argument)

param –feature_extractor_type:

the type of convnet to use. vit-b-p16 is the default: ViT-B/16 pretrained on Imagenet 21k (NO finetuning on ImageNet 1k)

Classes#

class models.ranpac.RanPAC(backbone, loss, args, transform, dataset=None)[source]#

Bases: ContinualModel

RanPAC: Random Projections and Pre-trained Models for Continual Learning.

COMPATIBILITY: List[str] = ['class-il', 'domain-il', 'task-il']#
NAME: str = 'ranpac'#
begin_task(dataset)[source]#
end_task(dataset)[source]#
forward(x)[source]#
freeze_backbone(is_first_session=False)[source]#
get_parameters()[source]#
static get_parser(parser)[source]#
Return type:

ArgumentParser

get_scheduler()[source]#
net: RanPAC_Model#
observe(inputs, labels, not_aug_inputs, epoch=0)[source]#
optimise_ridge_parameter(Features, Y)[source]#
replace_fc(trainloader)[source]#
setup_RP()[source]#