advertorch.defenses
¶
Defenses¶
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.
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.
Parameters: - channels – number of channels in the output.
- kernel_size – aperture size.
-
class
advertorch.defenses.
GaussianSmoothing2D
(sigma, channels, kernel_size=None)[source]¶ Gaussian Smoothing 2D.
Parameters: - 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.
Parameters: - 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.