This repo contains the code (not very neat) for my blog post on Adversarial Reprogramming. Based on this paper by the Google Brain team.
Make sure to have the following packages installed (python 3.6):
pytorch
0.4: Get pytorchwritefile-run
: To create python files from jupyter notebooks writefile-runpytorch-utils
: Set of utils I made to make training in jupyter notebooks easier pytorch-utils
- The
models.py
file contains the reprogramming modules. - Run the
AdvReprogMNIST2.ipynb
to train an adversarial program for MNIST using the scaling input transform. - The
LabelRemapping.ipynb
notebook implements the greedy multiple output label remapping for CIFAR. - Run the
AdvReprogCifar.ipynb
to train an adversarial program for CIFAR using the scaling input transform and the multiple output label remappings created above.