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.huggingface

A wrapper class that converts ๐Ÿค— Transformers models to composer models

composer.models.initializers

Module Initializers.

composer.models.model_hparams

General YAHP interface for Base ComposerModels.

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.resnet_cifar

A ResNet model family adapted for CIFAR10 image sizes.

composer.models.ssd

SSD300 for object detection on MSCOCO.

composer.models.tasks

Model tasks are ComposerModels with forward passes and logging built-in for many common deep learning tasks.

composer.models.timm

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

composer.models.unet

The Unet architecture used in image segmentation.

composer.models.vit_small_patch16([...])

Helper function to create a ComposerClassifier using a ViT-S/16 model.

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.

Functions

composer_deeplabv3

Helper function to create a ComposerClassifier with a DeepLabv3(+) model. Logs

composer_efficientnetb0

Helper function to create a ComposerClassifier with an EfficientNet-b0 architecture.

composer_resnet

Helper function to create a ComposerClassifier with a torchvision ResNet model.

composer_resnet_cifar

Helper function to create a ComposerClassifier with a CIFAR ResNet models.

composer_timm

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

create_bert_classification

BERT classification model based on ๐Ÿค— Transformers.

create_bert_mlm

BERT model based on ๐Ÿค— Transformers.

create_gpt2

Implements HuggingFaceModel to wrap Hugging Face GPT-2 transformers. Logs training and

mnist_model

Helper function to create a ComposerClassifier with a simple convolutional neural network.

vit_small_patch16

Helper function to create a ComposerClassifier using a ViT-S/16 model.

Classes

ComposerClassifier

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

ComposerModel

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

HuggingFaceModel

A wrapper class that converts ๐Ÿค— Transformers models to composer models.

Initializer

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

SSD

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

UNet

A U-Net model extending ComposerModel.

Hparams

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

BERTForClassificationHparams

YAHP interface for BERTModel.

BERTHparams

YAHP interface for BERTModel.

DeepLabV3Hparams

YAHP interface for

EfficientNetB0Hparams

YAHP interface for

GPT2Hparams

YAHP interface for GPT2Model.

MnistClassifierHparams

YAHP interface for mnist_model().

ModelHparams

General YAHP interface for ComposerModels.

ResNetCIFARHparams

Hparams interface for composer_resnet_cifar().

ResNetHparams

YAHP interface for composer_resnet().

SSDHparams

YAHP interface for SSD.

TimmHparams

YAHP interface for composer_timm().

UnetHparams

YAHP interface for UNet.

ViTSmallPatch16Hparams

YAHP interface for vit_small_batch16.