brails.processors.foundation_classifier.npid.npid_models.resnet_cifar module
ResNet in PyTorch.
For Pre-activation ResNet, see ‘preact_resnet.py’.
Reference: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Deep Residual Learning for Image Recognition. arXiv:1512.03385
- class brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.BasicBlock(in_planes, planes, stride=1)
Bases:
Module
- expansion = 1
- forward(x)
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.Bottleneck(in_planes, planes, stride=1)
Bases:
Module
- expansion = 4
- forward(x)
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.ResNet(block, num_blocks, low_dim=128)
Bases:
Module
- forward(x)
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.ResNet101(low_dim=128)
- brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.ResNet152(low_dim=128)
- brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.ResNet18(low_dim=128)
- brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.ResNet34(low_dim=128)
- brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.ResNet50(low_dim=128)
- brails.processors.foundation_classifier.npid.npid_models.resnet_cifar.test()