intro:
Implementation of Representation Learning with Contrastive Predictive Coding Paper (https://arxiv.org/abs/1807.03748).
linkCPC github
-
Download ILSVRC2012_img_val and save it in
.\data
dir -
The choosen validation set is written in
selected_data.csv
|-data
|-ILSVRC2012_img_val
| |-n01484850
| |-...
| └─...
└─selected_data.csv
-
Run
train.py
file to train the CPC encoder and save weight. -
Run
CpcAttack.py
to generate adv examples and evaluate them.e.g. run the attack 14 iterations using momentum 1.1 on gpu3 and evaluate on model vgg19_bn
python CpcAttack.py --model vgg19_bn --iters 14 --gpu 3 --momentum 1.1