robustness package
This is my attempt to replicate Ilyas et al. (2019), "Adversarial Examples Are Not Bugs, They Are Features".
Steps:
- Install via
pip
:pip install robustness
- Download the trained ResNet-50 provided in the original repo. It should be saved to this folder as
cifar_nat.pt
. - Run
generate_drand.py
to generate D_rand, as described in the paper. (takes 20min on A100) - Train a new ResNet-50 on the generated D_rand, via the following command (takes ~1hour on A100):
python -m robustness.main --dataset cifar --data ./cifar10/ --adv-train 0 --lr 0.01 --arch resnet50 --out-dir ./checkpoints/
Note that robustness/datasets.py
is modified so that cifar points to the newly generated D_rand.
Result: yep, after running this, I do see roughly the same generalization that they report in the paper!