BlurPool#
- class composer.algorithms.BlurPool(replace_convs=True, replace_maxpools=True, blur_first=True, min_channels=16)[source]#
BlurPool adds anti-aliasing filters to convolutional layers.
This algorithm increases accuracy and invariance to small shifts in the input. It runs on
Event.INIT.- Parameters
replace_convs (bool) โ replace strided
torch.nn.Conv2dmodules withBlurConv2dmodules. Default:True.replace_maxpools (bool) โ replace eligible
torch.nn.MaxPool2dmodules withBlurMaxPool2dmodules. Default:True.blur_first (bool) โ when
replace_convsisTrue, blur input before the associated convolution. When set toFalse, the convolution is applied with a stride of 1 before the blurring, resulting in significant overhead (though more closely matching the paper). SeeBlurConv2dfor further discussion. Default:True.min_channels (int, optional) โ Skip replacing layers with in_channels < min_channels. Commonly used to prevent the blurring of the first layer. Default: 16.