resnet#
- torch_uncertainty.models.resnet(in_channels, num_classes, arch, conv_bias=False, dropout_rate=0.0, width_multiplier=1.0, groups=1, style='imagenet', activation_fn=<function relu>, normalization_layer=<class 'torch.nn.modules.batchnorm.BatchNorm2d'>)[source]#
ResNet model.
- 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
False.dropout_rate (float) – Dropout rate. Defaults to 0.0.
width_multiplier (float) – Width multiplier. Defaults to 1.0.
groups (int) – Number of groups in convolutions. Defaults to 1.
style (bool, optional) – Whether to use the ImageNet structure. Defaults to
True.activation_fn (Callable, optional) – Activation function. Defaults to
torch.nn.functional.relu.normalization_layer (nn.Module, optional) – Normalization layer. Defaults to
torch.nn.BatchNorm2d.
- Returns:
The ResNet model.
- Return type:
_ResNet