Giter VIP home page Giter VIP logo

neural-pipeline's Introduction

Neural Pipeline

Neural networks training pipeline based on PyTorch. Designed to standardize training process and accelerate experiments.

Build Status Coverage Status Maintainability Gitter chat

  • Core is about 2K lines, covered by tests, that you don't need to write again
  • Flexible and customizable training process
  • Checkpoints management and train process resuming (source and target device independent)
  • Metrics processing and visualization by builtin (tensorboard, Matplotlib) or custom monitors
  • Training best practices (e.g. learning rate decaying and hard negative mining)
  • Metrics logging and comparison (DVC compatible)

Getting started:

Documentation

Documentation Status

See the examples

Neural Pipeline short overview:

import torch

from neural_pipeline.builtin.monitors.tensorboard import TensorboardMonitor
from neural_pipeline.monitoring import LogMonitor
from neural_pipeline import DataProducer, TrainConfig, TrainStage,\
    ValidationStage, Trainer, FileStructManager

from somethig import MyNet, MyDataset

fsm = FileStructManager(base_dir='data', is_continue=False)
model = MyNet().cuda()

train_dataset = DataProducer([MyDataset()], batch_size=4, num_workers=2)
validation_dataset = DataProducer([MyDataset()], batch_size=4, num_workers=2)

train_config = TrainConfig(model, [TrainStage(train_dataset),
                                   ValidationStage(validation_dataset)], torch.nn.NLLLoss(),
                           torch.optim.SGD(model.parameters(), lr=1e-4, momentum=0.5))

trainer = Trainer(train_config, fsm, torch.device('cuda:0')).set_epoch_num(50)
trainer.monitor_hub.add_monitor(TensorboardMonitor(fsm, is_continue=False))\
                   .add_monitor(LogMonitor(fsm))
trainer.train()

This example of training MyNet on MyDataset with vizualisation in Tensorflow and with metrics logging for further experiments comparison.

Installation:

PyPI version PyPI Downloads/Month PyPI Downloads

pip install neural-pipeline

For builtin module using install:

pip install tensorboardX matplotlib

Install latest version before it's published on PyPi

pip install -U git+https://github.com/toodef/neural-pipeline

neural-pipeline's People

Contributors

pfriesch avatar toodef avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.