ColOutTransform#
- class composer.algorithms.ColOutTransform(p_row=0.15, p_col=0.15, resize_target='auto')[source]#
Torchvision-like transform for performing the ColOut augmentation, where random rows and columns are dropped from up to two Torch tensors or two PIL images.
See the Method Card for more details.
Example
from torchvision import datasets, transforms from composer.algorithms.colout import ColOutTransform colout_transform = ColOutTransform(p_row=0.15, p_col=0.15) transforms = transforms.Compose([colout_transform, transforms.ToTensor()])
- Parameters
p_row (float, optional) โ Fraction of rows to drop (drop along H). Default:
0.15
.p_col (float, optional) โ Fraction of columns to drop (drop along W). Default:
0.15
.resize_target (bool | str, optional) โ Whether to resize the target in addition to the input. If set to
'auto'
, resizing the target will be based on if the target has the same spatial dimensions as the input. Default:'auto'
.