Skip to content

DenseNet

PyTorch implementation of DenseNet architecture1 as defined in Torchvision.

Pre-trained models

mozuma.models.densenet.pretrained.torch_densenet_imagenet

PyTorch DenseNet model pretrained on ImageNet

Parameters:

Name Type Description Default
densenet_arch DenseNetArch

Identifier for the DenseNet architecture. Must be one of:

- densenet121
- densenet161
- densenet169
- densenet201
required
device torch.device

Torch device to initialise the model weights

device(type='cpu')

Returns:

Type Description
TorchDenseNetModule

PyTorch DenseNet model pretrained on ImageNet

mozuma.models.densenet.pretrained.torch_densenet_places365

PyTorch DenseNet model pretrained on Places365.

See places365 documentation for more info.

Parameters:

Name Type Description Default
device torch.device

Torch device to initialise the model weights

device(type='cpu')

Returns:

Type Description
TorchDenseNetModule

PyTorch DenseNet model pretrained on Places365

Base model

The DenseNet model is an implementation of a TorchModel.

mozuma.models.densenet.modules.TorchDenseNetModule

PyTorch implementation of DenseNet

See TorchVision source code.

Attributes:

Name Type Description
densenet_arch DenseNetArch

Identifier for the DenseNet architecture. Must be one of:

- densenet121
- densenet161
- densenet169
- densenet201
label_set LabelSet

The output labels. Defaults to ImageNet 1000 labels.

device torch.device

Torch device to initialise the model weights

Pre-trained state origins

See the stores documentation for usage.

mozuma.models.densenet.stores.DenseNetTorchVisionStore

Model store to load DenseNet weights pretrained on ImageNet from TorchVision

mozuma.models.densenet.stores.DenseNetPlaces365Store

Model store to load DenseNet weights pretrained on Places365

See places365 documentation for more info.


  1. Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). July 2017.