Skip to main content

Library build on top of pytorch to fuel productivity

Project description


Build Status codecov

Build on top of pytorch to fuel productivity.


  • 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_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 =, train_dataloader, eval_dataloader)

How to install

Clone repository and run:

pip install .

Optionally (not up to date):

pip install torchfuel

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for torchfuel, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size torchfuel-0.1.3-py3-none-any.whl (18.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size torchfuel-0.1.3.tar.gz (11.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page