model#

A simple convolutional neural network extending ComposerClassifier.

Functions

mnist_model

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

Classes

Model

Toy convolutional neural network architecture in pytorch for MNIST.

class composer.models.classify_mnist.model.Model(initializers, num_classes=10)[source]#

Bases: torch.nn.modules.module.Module

Toy convolutional neural network architecture in pytorch for MNIST.

composer.models.classify_mnist.model.mnist_model(num_classes=10, initializers=None)[source]#

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

Parameters
  • num_classes (int, optional) โ€“ The number of classes. Needed for classification tasks. Default: 10

  • initializers (List[Initializer], optional) โ€“ list of Initializers for the model. None for no initialization. Default: None

Returns

ComposerModel โ€“ instance of ComposerClassifier with a simple MNIST model.

Example:

from composer.models import mnist_model

model = mnist_model()