ResNet
PyTorch implementation of ResNet1 as defined in Torchvision.
Pre-trained models
mozuma.models.resnet.pretrained.torch_resnet_imagenet
TorchResNetModule model pre-trained on ImageNet
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resnet_arch |
ResNetArchs |
Identifier for the ResNet architecture to load. Must be one of:
|
required |
device |
torch.device |
Torch device to initialise the model weights |
device(type='cpu') |
training_mode |
TorchResNetTrainingMode | None |
Whether to return features or labels in the forward function. Used for training when computing the loss. |
None |
Returns:
Type | Description |
---|---|
TorchResNetModule |
A PyTorch ResNet module pre-trained on ImageNet |
Base model
The ResNet model is an implementation of a TorchModel
.
mozuma.models.resnet.modules.TorchResNetModule
PyTorch ResNet architecture.
Attributes:
Name | Type | Description |
---|---|---|
resnet_arch |
ResNetArchs |
Identifier for the ResNet architecture to load. Must be one of:
|
label_set |
LabelSet |
The output labels. Defaults to ImageNet 1000 labels. |
device |
torch.device |
Torch device to initialise the model weights |
training_mode |
TorchResNetTrainingMode | None |
Whether to return features or labels in the forward function. Used for training when computing the loss. |
Pre-trained state origins
See the stores documentation for usage.
mozuma.models.resnet.stores.ResNetTorchVisionStore
Model store to load ResNet weights pretrained on ImageNet from TorchVision
-
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume, 770–778. 2016. doi:10.1109/CVPR.2016.90. ↩