packed_resnet#
- torch_uncertainty.models.packed_resnet(in_channels, num_classes, arch, num_estimators, alpha, gamma, conv_bias=False, width_multiplier=1.0, groups=1, dropout_rate=0, style=ResNetStyle.IMAGENET, normalization_layer=<class 'torch.nn.modules.batchnorm.BatchNorm2d'>, pretrained=False, linear_implementation='conv1d')[source]#
Packed-Ensembles of ResNet.
- Parameters:
in_channels (
int) – Number of input channels.num_classes (
int) – Number of classes to predict.arch (
int) – The architecture of the ResNet.conv_bias (
bool) – Whether to use bias in convolutions. Defaults toTrue.dropout_rate (
float) – Dropout rate. Defaults to0.num_estimators (
int) – Number of estimators in the ensemble.alpha (
float) – Expansion factor affecting the width of the estimators.gamma (
int) – Number of groups within each estimator.width_multiplier (
float) – Width multiplier. Defaults to1.groups (
int) – Number of groups within each estimator group.style (
ResNetStyle) – Whether to use the ImageNet or CIFAR structure. Defaults toResNetStyle.IMAGENET.normalization_layer (
type[Module]) – Normalization layer. Defaults tonn.BatchNorm2d.pretrained (
bool) – Whether to load pretrained weights. Defaults toFalse.linear_implementation (
str) – Implementation of the packed linear layer. Defaults to"conv1d".
- Returns:
A Packed-Ensembles ResNet.
- Return type:
_PackedResNet