The above link contains 3 Items:-
- CIFAR100Dataset : Contains zip file for CIFAR100 datasets
- ExperimentResultsResNet18: Contains the results of an analysis of a ResNet-18 on CIFAR-100
- A Pretrained ResNet-18 on CIFAR-100
- Python 3.7.6 and above
- Numpy 1.18.1 and above
- Pytorch 1.4.0 and above
- Scipy 1.4.1 and above
- install gradcam from https://github.com/jacobgil/pytorch-grad-cam
Prototype Command:
python3 dissectKNNResNet18.py FullPathToCifar100SuperClass/train/ FullPathToCifar100SuperClass/valKDD/ PathToPretrainedResnet18/Resnet18Cifar100 OutputFolderDirectory ResNet18Cifar100 20 20 50 1 1 1 1 1 0.001 0.00001 100 sgd NNDSVD False False False
Prototype Command 2 :
python3 dissectKNNResNet18.py /data/CifarLocal/train /data/CifarLocal/val/ None /outputs/DSAA2022Results/Cifar10/ ResNet18Cifar10 10 20 50 1 1 1 1 1 0.001 0.00001 100 sgd NNDSVD False False False
The parameter values shown were used for experimentation.
Use the following command to get help:
python3 dissectKNNResNet18.py -h
usage: dissectKNNResNet18.py [-h] rootDir rootDirTest networkFile outputFolderName NetworkName Rank1 numGroups maxIters lmbdaF lmbdaTV lmbdaOrtho samplingFactor samplingFactorTest lr wd numEpochs {sgd,adam,rmsprop} {random,ID,NNDSVD} {True,False} {True,False} {True,False}
positional arguments:
- rootDir Enter the name of root folder which containts the data subfolders :
- rootDirTest Enter the name of root folder which containts the test data subfolders :
- networkFile Enter the name of root folder which containts the Network :
- outputFolderName Enter the name(Path) of the Output Folder :
- NetworkName Enter the name(Path) of the network file :
- Rank1 Enter Rank 1 :
- numGroups Enter the number of groups:
- maxIters Enter Max no. of iterations:
- lmbdaF Enter lambda F:
- lmbdaTV Enter lambda TV:
- lmbdaOrtho Enter orthogonality penalty:
- samplingFactor Enter the ratio of dataset to be used:
- samplingFactorTest Enter the ratio of dataset to be used:
- lr learning rate for SGD to be used:
- wd Enter the weight decay:
- numEpochs Enter the number of epochs:
- {sgd,adam,rmsprop} Enter the optimization algorithm
- {random,ID,NNDSVD} Enter the initialization for P
- {True,False} Enter if class based training is required
- {True,False} Enter true if Data matrices have to be ignored
- {True,False} Enter true if F matrix is to have group sparsity