composer_resnet_cifar#

composer.models.composer_resnet_cifar(model_name, num_classes=10, initializers=None)[source]#

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

From Deep Residual Learning for Image Recognition (He et al, 2015). ResNet9 is based on the model from myrtle.ai blog.

Parameters
  • model_name (str) โ€“ "resnet_9", "resnet_20", or "resnet_56".

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

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

Returns

ComposerModel โ€“ instance of ComposerClassifier with a CIFAR ResNet model.

Example:

from composer.models import composer_resnet_cifar

model = composer_resnet_cifar(model_name="resnet_56")  # creates a resnet56 for cifar image classification