YuyangShi / Learning-to-Defend-by-Learning-to-Attack

11 stars 1 forks source link

About acc of L2L+AIT #2

Open Nono-404 opened 2 years ago

Nono-404 commented 2 years ago

Hello, when I run the code of train_1_interp_cifar10.py, I can't get the acc 80.87% when attacker is PGM20 in your paper, and I set epoch as 200, then I got 73.96%. Are there any tricks that you don't mention in your paper? Thank you.

Nono-404 commented 2 years ago

Here is some logs: Train Epoch: 200 [0/50000 (0%)] Loss_att: 0.752737 Loss: 1.677927 Train Epoch: 200 [12800/50000 (26%)] Loss_att: 0.708587 Loss: 1.682505 Train Epoch: 200 [25600/50000 (51%)] Loss_att: 0.754866 Loss: 1.677010 Train Epoch: 200 [38400/50000 (77%)] Loss_att: 0.722597 Loss: 1.682971 Time Elapsed: 403.2069315210101

Training: Average loss: 0.6210, Accuracy: 49987/50000 (100%) Test: Average loss: 0.8076, Accuracy: 9112/10000 (91%) Test Adv: Average loss: 1.1866, Accuracy: 7799/10000 (78%)

-------------------------------- PGD 10 White Box ---------------------------- natural_err_total: tensor(873., device='cuda:0') Acu: 0.9127 robust_err_total: tensor(2115., device='cuda:0') Acu: 0.7885 -------------------------------- PGD 20 White Box ---------------------------- natural_err_total: tensor(873., device='cuda:0') Acu: 0.9127 robust_err_total: tensor(2604., device='cuda:0') Acu: 0.7396 -------------------------------- PGD 100 White Box ---------------------------- natural_err_total: tensor(873., device='cuda:0') Acu: 0.9127 robust_err_total: tensor(3461., device='cuda:0') Acu: 0.6538999999999999