composer.models.resnet_cifar.resnets#

The CIFAR ResNet torch module.

See the Model Card for more details.

Classes

ResNet9

A 9-layer residual network, excluding BatchNorms and activation functions.

ResNetCIFAR

A residual neural network as originally designed for CIFAR-10.

class composer.models.resnet_cifar.resnets.ResNet9(num_classes=10)[source]#

Bases: torch.nn.modules.module.Module

A 9-layer residual network, excluding BatchNorms and activation functions.

Based on the myrtle.ai blog and Deep Residual Learning for Image Recognition (He et al, 2015).

Parameters

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

class composer.models.resnet_cifar.resnets.ResNetCIFAR(plan, initializers, outputs=10)[source]#

Bases: torch.nn.modules.module.Module

A residual neural network as originally designed for CIFAR-10.

class Block(f_in, f_out, downsample=False)[source]#

Bases: torch.nn.modules.module.Module

A ResNet block.

static get_model_from_name(model_name, initializers, outputs=10)[source]#

The naming scheme for a ResNet is 'resnet_D[_W]'.

D is the model depth (e.g. 'resnet_56')