composer.models#

Modules

composer.models.base

The ComposerModel base interface.

composer.models.bert

The BERT model family using Hugging Face Transformers.

composer.models.classify_mnist

A simple example convolutional neural network which can be used to classify MNIST data.

composer.models.deeplabv3

DeepLabV3 for image segmentation.

composer.models.efficientnetb0

The EfficientNet model family is a set of convolutional neural networks that can be used as the basis for a variety of vision tasks, but were initially designed for image classification.

composer.models.gpt2

The GPT-2 model family is set of transformer-based networks for autoregressive language modeling at various scales.

composer.models.loss

A collection of common torchmetrics and loss functions.

composer.models.model_hparams

General YAHP interface for ComposerModels.

composer.models.nlp_metrics

A collection of common torchmetrics for NLP tasks.

composer.models.resnet

The ResNet model family is a set of convolutional neural networks described in Deep Residual Learning for Image Recognition (He et al, 2015).

composer.models.resnet20_cifar10

A ResNet20 model for CIFAR10.

composer.models.resnet56_cifar10

A ResNet56 model for CIFAR10.

composer.models.resnet9_cifar10

A ResNet9 model for CIFAR10.

composer.models.resnets

The CIFAR ResNet torch module.

composer.models.ssd

SSD300 for object detection on MSCOCO.

composer.models.timm

A wrapper around timm.create_model() used to create ComposerClassifier.

composer.models.transformer_hparams

General YAHP interface for ComposerTransformers.

composer.models.transformer_shared

The ComposerModel base interface for Transformers.

composer.models.unet

The Unet architecture used in image segmentation.

composer.models.vit_small_patch16

ViT Small Patch 16 for image classification.

The models module contains the ComposerModel base class along with reference implementations of many common models. Additionally, it includes task-specific convenience ComposerModels that wrap existing Pytorch models with standard forward passes and logging to enable quick interaction with the Trainer.

See Composer Model for more details.

Classes

BERTModel

BERT model based on ๐Ÿค— Transformers.

CIFAR10_ResNet20

A ResNet-20 model extending ComposerClassifier.

CIFAR10_ResNet56

A ResNet-56 model extending ComposerClassifier.

CIFAR10_ResNet9

A ResNet-9 model extending ComposerClassifier.

ComposerClassifier

A convenience class that creates a ComposerModel for classification tasks from a vanilla PyTorch model.

ComposerDeepLabV3

DeepLabV3 model extending ComposerClassifier.

ComposerModel

The interface needed to make a PyTorch model compatible with composer.Trainer.

ComposerResNet

A ComposerClassifier wrapper around the torchvision implementations of the ResNet model family.

ComposerTransformer

The ComposerModel base interface for Transformers.

EfficientNetB0

A ComposerClassifier wrapper around the EfficientNet-b0 architecture.

GPT2Model

Implements ComposerTransformer to wrap Hugging Face GPT-2 transformers.

Initializer

Sets the initialization scheme for different layers of a PyTorch model.

MNIST_Classifier

A simple convolutional neural network extending ComposerClassifier.

SSD

Single Shot Object detection Model with pretrained ResNet34 backbone extending ComposerModel.

Timm

A wrapper around timm.create_model() used to create ComposerClassifier.

UNet

A U-Net model extending ComposerModel.

ViTSmallPatch16

Implements ViT-S/16 as a ComposerClassifier.

Hparams

These classes are used with yahp for YAML-based configuration.