Skip to main content

torchfuel

Build Status codecov

Build on top of pytorch to fuel productivity.

Features

  • Generic Trainer
  • Classification Trainer (with cross-entropy loss)
  • MSE Trainer
  • Additional utility layers
  • Better dataloaders (currently only for image datasets)

Classification Example

import os
import time
from collections import namedtuple

import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torchvision import datasets, models, transforms

from torchfuel.data_loaders.image import ImageDataLoader
from torchfuel.trainers.classification import ClassificationTrainer
from torchfuel.transforms.noise import DropPixelNoiser


dl = ImageDataLoader(
    train_data_folder='imgs/train',
    eval_data_folder='imgs/eval',
    pil_transformations=[transforms.RandomHorizontalFlip()]
    tensor_transformations=[DropPixelNoiser()],
    batch_size=64,
    imagenet_format=True,
)

train_dataloader, eval_dataloader, n_classes = dl.prepare()

device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')

model = Model(...).to(device)

optimiser = optim.SGD(model.parameters(), lr=0.01, momentum=0.9)

scheduler = optim.lr_scheduler.ReduceLROnPlateau(optimiser, 'min', patience=20)

trainer = ClassificationTrainer(device, model, optimiser, scheduler)

fitted_model = trainer.fit(epochs, train_dataloader, eval_dataloader)

How to install

Clone repository and run:

pip install .

Optionally (not up to date):

pip install torchfuel

Metadata

Release files for torchfuel 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torchfuel 0.1.3
File Size Uploaded Provenance Actions
torchfuel-0.1.3.tar.gz 11.0 kB Without provenance Details for torchfuel-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for torchfuel 0.1.3
File Interpreter ABI Platform Actions
torchfuel-0.1.3-py3-none-any.whl Python 3 none any Details for torchfuel-0.1.3-py3-none-any.whl

Total release size: 29.8 kB

Release files / torchfuel-0.1.3.tar.gz

Download URL torchfuel-0.1.3.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
15d8d31bfe980965ce9ad91243929593e9df593d590cd7d2bdb6fe6266f1fc14
BLAKE2b-256 checksum
How to use checksums
a72ccf946479015d33140975a56f166b3c4fc874703072d8e5495a6a24d97f90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / torchfuel-0.1.3-py3-none-any.whl

Download URL torchfuel-0.1.3-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
409fe0430fd83e54b8a7112b7d53e3c2412dbf76e14a31296137fff55f977ad9
BLAKE2b-256 checksum
How to use checksums
508799f54ec046e447e6ca30353a30d808cf3bdf290e62df4e27b0ac9c74b60e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Security for torchfuel 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page