ResNet#
eqxvision.models.ResNet
#
A simple port of torchvision.models.resnet
__init__(self, block: Type[Union[_ResNetBasicBlock, _ResNetBottleneck]], layers: List[int], num_classes: int = 1000, groups: int = 1, width_per_group: int = 64, replace_stride_with_dilation: List[bool] = None, norm_layer: Any = None, *, key: Optional[jax.random.PRNGKey] = None)
#
Arguments:
block
:Bottleneck
orBasicBlock
for constructing the networklayers
: A list containing number ofblocks
at different levelsnum_classes
: Number of classes in the classification task. Also controls the final output shape(num_classes,)
. Defaults to1000
groups
: Number of groups to form along the feature depth. Defaults to1
width_per_group
: Increases width ofblock
by a factor ofwidth_per_group/64
. Defaults to64
replace_stride_with_dilation
: Replacing2x2
strides with dilated convolution. Defaults to Nonenorm_layer
: Normalisation to be applied on the inputs. Defaults toBatchNorm
key
: Ajax.random.PRNGKey
used to provide randomness for parameter initialisation. (Keyword only argument.)
Exceptions:
NotImplementedError
: If anorm_layer
other thanequinox.experimental.BatchNorm
is usedValueError
: Ifreplace_stride_with_convolution
is notNone
or a3-tuple
__call__(self, x: Array, *, key: jax.random.PRNGKey) -> Array
#
Arguments:
x
: The input. Should be a JAX array with3
channelskey
: Required parameter. Utilised by few layers such asDropout
orDropPath
eqxvision.models.resnet18(torch_weights = None, **kwargs) -> ResNet
#
ResNet-18 model from
"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>
_
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone
eqxvision.models.resnet34(torch_weights = None, **kwargs) -> ResNet
#
ResNet-34 model from
"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>
_
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone
eqxvision.models.resnet50(torch_weights = None, **kwargs) -> ResNet
#
ResNet-50 model from Deep Residual Learning for Image Recognition
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone
eqxvision.models.resnet101(torch_weights = None, **kwargs) -> ResNet
#
ResNet-101 model from Deep Residual Learning for Image Recognition
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone
eqxvision.models.resnet152(torch_weights = None, **kwargs) -> ResNet
#
ResNet-152 model from Deep Residual Learning for Image Recognition
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone
eqxvision.models.resnext50_32x4d(torch_weights = None, **kwargs) -> ResNet
#
ResNeXt-50 32x4d model from Aggregated Residual Transformation for Deep Neural Networks
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone
eqxvision.models.resnext101_32x8d(torch_weights = None, **kwargs) -> ResNet
#
ResNeXt-101 32x8d model from Aggregated Residual Transformation for Deep Neural Networks
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone
eqxvision.models.wide_resnet50_2(torch_weights = None, **kwargs) -> ResNet
#
Wide ResNet-50-2 model from Wide Residual Networks The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048 channels, and in Wide ResNet-50-2 has 2048-1024-2048.
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone
eqxvision.models.wide_resnet101_2(torch_weights = None, **kwargs) -> ResNet
#
Wide ResNet-101-2 model from Wide Residual Networks The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048 channels, and in Wide ResNet-50-2 has 2048-1024-2048.
Arguments:
torch_weights
: APath
orURL
for thePyTorch
weights. Defaults toNone