Skip to main content

Catalyst. High-level utils for PyTorch DL & RL research.

Project description

Catalyst logo

Reproducible and fast DL & RL

Pipi version Docs PyPI Status Github contributors License

Build Status Telegram Gitter Slack Donate

High-level utils for PyTorch DL & RL research. It was developed with a focus on reproducibility, fast experimentation and code/ideas reusing. Being able to research/develop something new, rather than write another regular train loop.

Break the cycle - use the Catalyst!


Installation

Common installation:

pip install -U catalyst

More specific with additional requirements:

pip install catalyst[dl] # installs DL based catalyst with Weights & Biases support
pip install catalyst[rl] # installs DL+RL based catalyst
pip install catalyst[drl] # installs DL+RL based catalyst with Weights & Biases support
pip install catalyst[contrib] # installs DL+contrib based catalyst
pip install catalyst[all] # installs everything. Very convenient to deploy on a new server

Catalyst is compatible with: Python 3.6+. PyTorch 0.4.1+.

Docs and examples

API documentation and an overview of the library can be found here Docs.

In the examples folder of the repository, you can find advanced tutorials and Catalyst best practices.

Blog

To learn more about Catalyst internals and to be aware of the most important features, you can read Catalyst-info, our blog where we regularly write facts about the framework.

Awesome list of Catalyst-powered repositories

We supervise the Awesome Catalyst list. You can make a PR with your project to the list.

Releases

We release a major release once a month with a name like YY.MM. And micro-releases with hotfixes and framework improvements in the format YY.MM.#.

You can view the changelog on the GitHub Releases page.

Current version: Pipi version

Overview

Catalyst helps you write compact but full-featured DL & RL pipelines in a few lines of code. You get a training loop with metrics, early-stopping, model checkpointing and other features without the boilerplate.

Features

  • Universal train/inference loop.
  • Configuration files for model/data hyperparameters.
  • Reproducibility – all source code and environment variables will be saved.
  • Callbacks – reusable train/inference pipeline parts.
  • Training stages support.
  • Easy customization.
  • PyTorch best practices (SWA, AdamW, 1Cycle, Ranger optimizer, FP16 and more).

Structure

  • DL – runner for training and inference, all of the classic machine learning and computer vision metrics and a variety of callbacks for training, validation and inference of neural networks.
  • RL – scalable Reinforcement Learning, on-policy & off-policy algorithms and their improvements with distributed training support.
  • contrib - additional modules contributed by Catalyst users.
  • data - useful tools and scripts for data processing.

Getting started: 30 seconds with Catalyst

import torch
from catalyst.dl import SupervisedRunner

# experiment setup
logdir = "./logdir"
num_epochs = 42

# data
loaders = {"train": ..., "valid": ...}

# model, criterion, optimizer
model = Net()
criterion = torch.nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(model.parameters())
scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer)

# model runner
runner = SupervisedRunner()

# model training
runner.train(
    model=model,
    criterion=criterion,
    optimizer=optimizer,
    scheduler=scheduler,
    loaders=loaders,
    logdir=logdir,
    num_epochs=num_epochs,
    verbose=True,
)

For Catalyst.RL introduction, please follow OpenAI Gym example.

Docker

Catalyst has its own DockerHub page:

  • catalystteam/catalyst:{CATALYST_VERSION} – simple image with Catalyst
  • catalystteam/catalyst:{CATALYST_VERSION}-fp16 – Catalyst with FP16
  • catalystteam/catalyst:{CATALYST_VERSION}-dev – Catalyst for development with all the requirements
  • catalystteam/catalyst:{CATALYST_VERSION}-dev-fp16 – Catalyst for development with FP16

To build a docker from the sources and get more information and examples, please visit docker folder.

Contribution guide

We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us.

Donate

License

This project is licensed under the Apache License, Version 2.0 see the LICENSE file for details License

Citation

Please use this bibtex if you want to cite this repository in your publications:

@misc{catalyst,
    author = {Kolesnikov, Sergey},
    title = {Reproducible and fast DL & RL.},
    year = {2018},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/catalyst-team/catalyst}},
}

Project details


Release history Release notifications | RSS feed

This version

19.11

Download files

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

Source Distribution

catalyst-19.11.tar.gz (177.6 kB view details)

Uploaded Source

Built Distribution

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

catalyst-19.11-py2.py3-none-any.whl (279.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file catalyst-19.11.tar.gz.

File metadata

  • Download URL: catalyst-19.11.tar.gz
  • Upload date:
  • Size: 177.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for catalyst-19.11.tar.gz
Algorithm Hash digest
SHA256 3ede0135a51a8f618b14539914ebebc02a5affcd8edffe9a174c0acc7e9ca33b
MD5 d006db4d8d89ade8c679268e81ac78ee
BLAKE2b-256 b6ba54c9fe822200ee29d4002b2d9128d9fff9310ccc63da9ecb9380a9dae8e0

See more details on using hashes here.

File details

Details for the file catalyst-19.11-py2.py3-none-any.whl.

File metadata

  • Download URL: catalyst-19.11-py2.py3-none-any.whl
  • Upload date:
  • Size: 279.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for catalyst-19.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 595ca673b2f19ea8485d992aeb1b600cfcd9d0f08f7a9246be370d18bb4b48d5
MD5 c88cee20b60268921b19ed5bb36497c6
BLAKE2b-256 2e61eb38fe27ba18a0852562f2ab2c2a41ab7fcacf2ab6fd0e6e287287d91a70

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