-
Notifications
You must be signed in to change notification settings - Fork 22
Blurring function in blur defense? #3
Copy link
Copy link
Open
Description
It looks like the blur function in the blur defense and training code,
selfstudy-adversarial-robustness/training/train_blur.py
Lines 41 to 45 in 15d1c01
| def blur(x): | |
| x_pad = np.pad(x, [(0, 0), (1, 1), (1, 1), (0, 0)]) | |
| x_pad = (x_pad[:, :1] + x_pad[:, :-1])/2 | |
| x_pad = (x_pad[:, :, :1] + x_pad[:, :, :-1])/2 | |
| return x_pad |
, is functionally equivalent to:
np.pad(x, [(0, 0), (1, 0), (1, 0), (0, 0)]) / 4
At least, x_pad[:, :1] and x_pad[:, :, :1] are the zero vectors. I assume this was meant to be a box blur and those offsets should be changed accordingly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels