Harry24k / adversarial-attacks-pytorch

PyTorch implementation of adversarial attacks [torchattacks]

Home Page:https://adversarial-attacks-pytorch.readthedocs.io/en/latest/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advice for calculating the time in demo code

Harr7y opened this issue · comments

Firstly, thanks for the nice contributions.

I have a little advice for your demo code :

https://github.com/Harry24k/adversarial-attacks-pytorch/blob/master/demos/White%20Box%20Attack%20(ImageNet).ipynb

The third part:3. Adversarial Attack
in the loop
"
for images, labels in data_loader:
start = time.time()
……
"
I think 'start' should be outside of the loop. I know the demo only have an image in the dataset, but when I apply it to other common datasets with batch size larger than 1, it may lead to some confusion.

Thank you. I fixed the demo. 😄