composer.functional
Algorithms can be used directly through our functions-based API.
from composer import functional as CF
from torchvision import models
model = models.resnet50()
# replace some layers with blurpool
CF.apply_blurpool(model)
# replace some layers with squeeze-excite
CF.apply_se(model, latent_channels=64, min_channels=128)
Perform augmentations. |
|
Applies BlurPool algorithm to the provided model. |
|
Drops random rows and columns from a single image. |
|
Implements CutOut augmentation from https://arxiv.org/abs/1708.04552 on the batch level. |
|
Shrinks targets towards a prior distribution to counteract label noise. |
|
Implements the layer freezing algorithm. |
|
Implements mixup on a single batch of data. |
|
Resize inputs and optionally outputs by cropping or interpolating. |
|
Perform augmentations. |
|
Select a subset of the batch on which to learn. |
|
Adds Squeeze-and-Excitation <https://arxiv.org/abs/1709.01507>`_ (SE) blocks after the Conv2d layers of a neural network. |