Skip to main content

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)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page