ConvSmoothing2D Conv Smoothing 2D.
AverageSmoothing2D Average Smoothing 2D.
GaussianSmoothing2D Gaussian Smoothing 2D.
MedianSmoothing2D Median Smoothing 2D.
JPEGFilter JPEG Filter.
BitSqueezing Bit Squeezing.
BinaryFilter Binary Filter.

Detailed description

class advertorch.defenses.Processor[source]
class advertorch.defenses.ConvSmoothing2D(kernel)[source]

Conv Smoothing 2D.

Parameters:kernel_size – size of the convolving kernel.
class advertorch.defenses.AverageSmoothing2D(channels, kernel_size)[source]

Average Smoothing 2D.

  • channels – number of channels in the output.
  • kernel_size – aperture size.
class advertorch.defenses.GaussianSmoothing2D(sigma, channels, kernel_size=None)[source]

Gaussian Smoothing 2D.

  • sigma – sigma of the Gaussian.
  • channels – number of channels in the output.
  • kernel_size – aperture size.
class advertorch.defenses.MedianSmoothing2D(kernel_size=3, stride=1)[source]

Median Smoothing 2D.

  • kernel_size – aperture linear size; must be odd and greater than 1.
  • stride – stride of the convolution.
class advertorch.defenses.JPEGFilter(quality=75)[source]

JPEG Filter.

Parameters:quality – quality of the output.
class advertorch.defenses.BitSqueezing(bit_depth, vmin=0.0, vmax=1.0)[source]

Bit Squeezing.

  • bit_depth – bit depth.
  • vmin – min value.
  • vmax – max value.
class advertorch.defenses.BinaryFilter(vmin=0.0, vmax=1.0)[source]

Binary Filter.

  • vmin – min value.
  • vmax – max value.