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)
Applies AugMix (Hendrycks et al.) data augmentation to an image. |
|
Add anti-aliasing filters to the strided |
|
Removes position embeddings and replaces the attention function and attention mask according to AliBi. |
|
Drops random rows and columns from a single image. |
|
See |
|
Shrinks targets towards a uniform distribution to counteract label noise as in Szegedy et al.. |
|
Progressively freeze the layers of the network during training, starting with the earlier layers. |
|
Replace batch normalization modules with ghost batch normalization modules. |
|
Create new samples using convex combinations of pairs of samples. |
|
Resize inputs and optionally outputs by cropping or interpolating. |
|
Randomly applies a sequence of image data augmentations (Cubuk et al. 2019). |
|
Makes a learning rate schedule take a different number of epochs. |
|
Select a subset of the batch on which to learn as per (Jiang et al. 2019). |
|
See |
|
Progressively increases the sequence length during training. |
|
Applies Stochastic Depth (Huang et al.) to the specified model. |