Open dxoigmn opened 3 years ago
You're completely correct. The intent was to have
x_pad = (x_pad[:, 1:] + x_pad[:, :-1])/2
instead of
x_pad = (x_pad[:, :1] + x_pad[:, :-1])/2
which would actually do a blur, instead of whatever weird no-op this current thing does.
It looks like the blur function in the blur defense and training code, https://github.com/google-research/selfstudy-adversarial-robustness/blob/15d1c0126e3dbaa205862c39e31d4e69afc08167/training/train_blur.py#L41-L45
, is functionally equivalent to:
At least,
x_pad[:, :1]
andx_pad[:, :, :1]
are the zero vectors. I assume this was meant to be a box blur and those offsets should be changed accordingly.