A simple hook based implementation of "Deep Networks with Stochastic Depth" for torchvision resnets.
Project description
Stochastic Depth with PyTorch Hooks
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 sdepth import set_hooks
set_hooks(resnet, p=0.2)
x = torch.zeros((8, 3, 224, 224), dtype=torch.float32, device=device)
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.0.tar.gz
(2.2 kB
view hashes)