/AdversarialReprogramming

Code for my blog post on Adversarial Reprogramming

Primary LanguageJupyter Notebook

Adversarial Reprogramming

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 pytorch
  • writefile-run : To create python files from jupyter notebooks writefile-run
  • pytorch-utils : Set of utils I made to make training in jupyter notebooks easier pytorch-utils

Description of files

  • 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.