Giter Site home page Giter Site logo

cschoeller / pycandle Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 1.0 88 KB

Lightweight library for executing PyTorch experiments without boilerplate code.

License: MIT License

Python 100.00%
pytorch deep-learning neural-networks python machine-learning

pycandle's Introduction

# PyCandle

PyCandle is a lightweight library for pytorch that makes running experiments easy, structured, repeatable and avoids boilerplate code. It maintains flexibilty and allows to train also more complex models like recurrent or generative neural networks conveniently.

Usage

This code snippet creates a timestamped directory for the current experiment, runs the training of the model, creates a backup of all used code, logs current git hash and forks console output into a log file:

model = Net().cuda()
experiment = Experiment('mnist_example')
train_loader = load_dataset(batch_size_train=64)
optimizer = torch.optim.Adam(model.parameters(), lr=0.01)
model_trainer = ModelTrainer(model, optimizer, F.nll_loss, 20, train_loader, device=0)
model_trainer.start_training()

A complete example for training a model to classify hand-written MNIST digits can be found in minimal_example/mnist.py.

Installation

Using PyCandle is very simple: Clone the repository anywhere on your machine and then create symlink with ln -s <path> in your machine learning project that points to the pycandle folder. Then you can just include modules with import pycandle.*. This is also how we use it in our example.

Alternatively, it is now possible to install PyCandle with pip:

pip3 install pycandle

Requirements

We tested PyCandle with the dependency versions listed here. However, PyCandle can also work with newer versions if they are downward compatible.

  • Python >= 3.5
  • PyTorch >= 1.2
  • numpy >= 1.16.4
  • torchvision >= 0.2.1 (for examples)
  • matplotlib >= 2.1.1 (for examples)

pycandle's People

Contributors

cschoeller avatar odysseaspap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

odysseaspap

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.