Official implementation of "Improving Shift Invariance in Convolutional Neural Networks with Translation Invariant Polyphase Sampling"
TIPS: Translation Invariant Polyphase Sampling is a learnable pooling operator that provide robustness against shift perturbation of images.
Please install the following libraries:
- pytorch
- PIL
- torchvision
- numpy
-
To train and evaluate at one go, run the following command:
-
Goto the directory in terminal where the code base (unzipped) is to train with TIPS
python3 train_test.py --MODEL_PATH "/...directory to save & load your model weights../" --tips --model_name 'resnet50' --epochs 480 --batch_size 64 --dataset 'tiny-imagenet' --data_path "/...directory containing dataset../" --num_down 5 --num_classes 200 --device 'cuda:0' --wake_up_at 100
python3 train_test.py --MODEL_PATH "/...directory to save & load your model weights../" --aps --model_name 'resnet50' --epochs 480 --batch_size 64 --dataset 'tiny-imagenet' --data_path "/...directory containing dataset../" --num_down 5 --num_classes 200 --device 'cuda:0'
python3 train_test.py --MODEL_PATH "/...directory to save & load your model weights../" --avgpool --model_name 'resnet50' --epochs 480 --batch_size 64 --dataset 'tiny-imagenet' --data_path "/...directory containing dataset../" --num_down 5 --num_classes 200 --device 'cuda:0'
python3 train_test.py --MODEL_PATH "/...directory to save & load your model weights../" --maxpool --model_name 'resnet50' --epochs 480 --batch_size 64 --dataset 'tiny-imagenet' --data_path "/...directory containing dataset../" --num_down 5 --num_classes 200 --device 'cuda:0'
python3 train_test.py --MODEL_PATH "/...directory to save & load your model weights../" --blurpool --model_name 'resnet50' --epochs 480 --batch_size 64 --dataset 'tiny-imagenet' --data_path "/...directory containing dataset../" --num_down 5 --num_classes 200 --device 'cuda:0'
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.


