Resnet implementation in pytorch
Project description
torch-resnet
Unified torch implementation of Resnets with or without pre-activation/width.
This implementation propose Resnets both for small and "large" images (Cifar vs ImageNet) and implements all the model used in the papers introducing the ResNets. Additional models can easily be created using the default class ResNet or PreActResNet. It is also possible to create your own block following the same model as those implemented.
Install
$ pip install torch-resnet
Getting started
import torch
import torch_resnet
from torch_resnet.utils import count_layer
model = torch_resnet.PreActResNet50() # Build a backbone Resnet50 with pre-activation
model.set_head(nn.Linear(model.out_planes, 10)) # Set a final linear head
count_layers(model) # -> 54 (In the original paper they do not count shortcut/downsampling layers)
out = model(torch.randn(1, 3, 224, 224))
Results
Work in progress
References
- [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. https://arxiv.org/pdf/1512.03385
- [2] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Identity Mappings in Deep Residual Networks. https://arxiv.org/pdf/1603.05027
- [3] Sergey Zagoruyko, Nikos Komodakis Wide Residual Networks. https://arxiv.org/pdf/1605.07146
Build and Deploy
$ python -m build
$ python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torch-resnet-0.0.1.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for torch_resnet-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc6b972a76131322752dc21b3e432c462a6d0b071f73f1b608271ce40d3602c6 |
|
MD5 | 53c771bf14c99cb31ccbaebd08f91c26 |
|
BLAKE2b-256 | 83cccb08e7bf11d68463cb2d3354eda365ca97fd69e1b7300dac00f45e137023 |