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):
pytorch0.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.pyfile contains the reprogramming modules. - Run the
AdvReprogMNIST2.ipynbto train an adversarial program for MNIST using the scaling input transform. - The
LabelRemapping.ipynbnotebook implements the greedy multiple output label remapping for CIFAR. - Run the
AdvReprogCifar.ipynbto train an adversarial program for CIFAR using the scaling input transform and the multiple output label remappings created above.