Harry24k / adversarial-attacks-pytorch

PyTorch implementation of adversarial attacks [torchattacks].
https://adversarial-attacks-pytorch.readthedocs.io/en/latest/index.html
MIT License
1.79k stars 337 forks source link

[QUESTION] I have got confused by the code description #186

Open EthanChu7 opened 1 month ago

EthanChu7 commented 1 month ago

❔ Any questions

I have got confused by the description in all attack file, which is

Does N = number of batches mean batch_size instead of number of batches?

rikonaka commented 1 month ago

Hi @EthanChu7 , a very simple explanation, if I have a hundred CIFAR-10 data, then its shape is as follows: (100, 3, 32, 32)

EthanChu7 commented 1 month ago

Hi @rikonaka, thanks for the reply and I understand now. BTW, for me the "number of batches" is still a confusing phrase, because in most cases a batch of data contains multiple images. For example, suppose we have 64 images, when the "batch_size" is 32, then the "number of batches" will be 2. when we feed images into the attack functions, the images shape is (32, 3, H, W) instead of (2 (number of batches), 3, H, W). In my opinion, the phrase "number of batches" could be rephrased to avoid confusion.

rikonaka commented 1 month ago

There is no such batch_size, this is just a description of how much the images is.