Skip to main content

Neural networks training pipeline based on PyTorch. Designed to standardize training process and to increase coding preformance

Project description

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

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

piepline-0.1.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piepline-0.1.0-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

Details for the file piepline-0.1.0.tar.gz.

File metadata

  • Download URL: piepline-0.1.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7

File hashes

Hashes for piepline-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a4dccf5756114815c37c8afe0d2b9eec13a111c57e763bac1fcfdd7ee2335ab
MD5 d48f4ce52aa045822c7cc8343262f127
BLAKE2b-256 8bf109942817d230a73ac04b032cf1bf5fbc03e5e8eca9f8d4cf5a2027fef977

See more details on using hashes here.

File details

Details for the file piepline-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: piepline-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7

File hashes

Hashes for piepline-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f75a9aa5619fa77c70d82dd201dce2afea6ff3ab8e1dbfc30f1f005157698576
MD5 cd45a139d3c7a3e2a09b83aa28a37105
BLAKE2b-256 b0b56f8548e8d219a6195e465d5743007a112f88ec7ad83f329658e62868fe1d

See more details on using hashes here.

Supported by

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