Skip to content

Blurring function in blur defense? #3

@dxoigmn

Description

@dxoigmn

It looks like the blur function in the blur defense and training code,

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions