Skip to main content

Small utilities for PyTorch

Project description

Weaver PyTorch 🧶🧵

from weaver import get_classifier, get_optimizer, get_scheduler, get_transforms
from torchvision.transforms import Compose
model = get_classifier('torchvision', 'resnet50')
optim = get_optimizer(model.parameters(), name='SGD', lr=1e-3)
sched = get_scheduler(optim, name='CosineAnnealingLR', T_max=10)
transform = Compose(get_transforms([
    {'name': 'RandAugment', 'num_ops': 2, 'magnitude': 10},
    {"name": "ToTensor"},
    {"name": "Normalize", "mean": "cifar10", "std": "cifar10"}
]))

Install

pip install weaver-pytorch-rnx0dvmdxk

API

get_classifier(src, name, **kwargs)

get_optimizer(params, name, **kwargs)

get_scheduler(optim, name, **kwargs)

get_transform(name, **kwargs)

get_transforms(kwargs_list)

  • get list of transforms

Others

  • weaver.optimizers.exclude_wd(module: Module, skip_list=['bias', 'bn'])
  • weaver.optimizers.EMAModel(model: Module, alpha: float)
  • weaver.datasets.IndexedDataset
  • weaver.datasets.RandomSubset

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

weaver-pytorch-rnx0dvmdxk-0.0.3.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

weaver_pytorch_rnx0dvmdxk-0.0.3-py3-none-any.whl (12.9 kB view hashes)

Uploaded Python 3

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