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='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 to True.

  • dropout_rate (float) – Dropout rate. Defaults to 0.

  • num_estimators (int) – Number of estimators in the ensemble.

  • alpha (int) – Expansion factor affecting the width of the estimators.

  • gamma (int) – Number of groups within each estimator.

  • width_multiplier (float) – Width multiplier. Defaults to 1.

  • groups (int) – Number of groups within each estimator group.

  • style (bool, optional) – Whether to use the ImageNet structure. Defaults to True.

  • normalization_layer (nn.Module, optional) – Normalization layer.

  • pretrained (bool, optional) – Whether to load pretrained weights. Defaults to False.

  • linear_implementation (str, optional) – Implementation of the packed linear layer. Defaults to "conv1d".

Returns:

A Packed-Ensembles ResNet.

Return type:

_PackedResNet