A simple hook based implementation of "Deep Networks with Stochastic Depth" for torchvision resnets.
Project description
Stochastic Depth with PyTorch Hooks
![PyPI version](https://pypi-camo.freetls.fastly.net/2d1acca8a90d58a485ed081d72af1209f0c7fe15/68747470733a2f2f62616467652e667572792e696f2f70792f73746f636864657074682e737667)
A simple hook based implementation of Deep Networks with Stochastic Depth for torchvision resnets.
Example
import torch
import torchvision.models as models
resnet = models.resnet152(pretrained=False)
from stochdepth import set_hooks
set_hooks(resnet, p=0.2)
x = torch.zeros((8, 3, 224, 224), dtype=torch.float32)
resnet.train()
y = resnet(x)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stochdepth-0.1.2.tar.gz
(2.3 kB
view hashes)