/cdfsl

Primary LanguagePython

CDFSL

Edit and set paths using

source set_env.sh

Pretrained weights:

Store weights in this folder structure

-cdfsl
    -weights
        -imagenet-net
            -model_best.pth.tar
        -url
            -model_best.pth.tar    

NCC, fine-tuning

For ImageNet trained backbone

python ./finetune.py --model.name=imagenet-net --model.backbone=resnet18 --data.test traffic_sign mnist --train.max_iter 50 --train.learning_rate 0.001

For using URL backbone

python ./finetune.py --model.name=url --model.backbone=resnet18 --data.test traffic_sign mnist --train.max_iter 50 --train.learning_rate 0.001

Adapt batchnorm and then do NCC, fine-tuning

python ./bn_finetune.py --model.name=url --model.backbone=resnet18 --data.test traffic_sign mnist --train.max_iter 50 --train.learning_rate 0.001

Prototypical network based fine-tuning

Trainable params: batch norm parameters

python prototypical_network.py --data.test cifar10 --model.name url --log logs/cifar10 --test.size 50 --train.max_iter 50 --train.learning_rate 0.001

References