fra31 / auto-attack

Code relative to "Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks"
https://arxiv.org/abs/2003.01690
MIT License
661 stars 113 forks source link

remove unnecessary var and loop #90

Closed s-kumano closed 2 years ago

s-kumano commented 2 years ago

First of all, thank you for your excellent research and code!

I have removed a variable and a loop that does not seem necessary. This PR contains the following modifications.

  1. Remove an unnecessary var in attack_single_run (fab_base.py).
  2. Remove an unnecessary loop in attack_single_run (fab_base.py).

Although Git shows that I made a lot of changes, I change just a few lines essentially. These changes do not affect the running of this program.

1. Remove an unnecessary var in attack_single_run (fab_base.py).

The variable res_c was not used. res_c is defined in L127 and changed in L265. However, it has not been used since that. Probably, it is derived from this code in fab-attack. I think it should be removed in fab_base.py.

2. Remove an unnecessary loop in attack_single_run (fab_base.py).

The loop L132 and the variable counter_restarts (L130) are not needed. I am sorry if you left this intentionally for some reason. However, unless there is a specific reason, it is probably best to remove them. These can cause slight confusion if one does not know L284 in advance.

ScarlettChan commented 2 years ago

您好,您的邮件已收到!

fra31 commented 2 years ago

Hi,

thanks for the contribution! Yeah, I think both derive from the implementation of FAB you mentioned, it should be safe to remove them. I'll quickly check it and then merge.