-
-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why doing Normalization before attack? (preprocessing) #681
Comments
Hi,
|
Question1 Question 2. Using Custom dataset (related to question 1) Question3. Clipped_advs is not having value between 0 - 1 preprocessing = dict(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], axis=-3) |
You can preprocess data yourself or have Foolbox's model do it. It's a choice. In any case, you should provide the correct bounds to Foolbox's model.
|
Here are a few points in addition to the previous answer:
|
At some point in the past, I wanted to figure out the actual difference between Specifically I found that, if |
foolbox/foolbox/attacks/base.py Line 288 in 1c55ee4
Before being returned, |
See #654 (comment). 😄 |
As I know, we should not normalize before Attacks. Does Foolbox also follow this principle?
1.
Foolbox explanation says: bounds [0,1] -> preprocessing(normalization)
However, the image tensor is [0,1] which doesn’t match with an explanation.
Using 'transforms.ToTensor()' already makes in the [0, 1] value range.
So we don't need to normalize in this case?
ex. transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])
ex. Clipped_Adv: [ 0.5029, 0.4851, 0.0167, ..., -1.1999, -1.1302, -0.9559]
The text was updated successfully, but these errors were encountered: