Skip to content
/ trains Public
forked from allegroai/clearml

TRAINS - Auto-Magical Experiment Manager & Version Control for AI

License

Notifications You must be signed in to change notification settings

melnimr/trains

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRAINS

Auto-Magical Experiment Manager & Version Control for AI

"Because it’s a jungle out there"

GitHub license PyPI pyversions PyPI version shields.io PyPI status

Behind every great scientist are great repeatable methods. Sadly, this is easier said than done.

When talented scientists, engineers, or developers work on their own, a mess may be unavoidable. Yet, it may still be manageable. However, with time and more people joining your project, managing the clutter takes its toll on productivity. As your project moves toward production, visibility and provenance for scaling your deep-learning efforts are a must.

For teams or entire companies, TRAINS logs everything in one central server and takes on the responsibilities for visibility and provenance so productivity does not suffer. TRAINS records and manages various deep learning research workloads and does so with practically zero integration costs.

We designed TRAINS specifically to require effortless integration so that teams can preserve their existing methods and practices. Use it on a daily basis to boost collaboration and visibility, or use it to automatically collect your experimentation logs, outputs, and data to one centralized server.

(See TRAINS live at https://demoapp.trainsai.io) Alt Text

Main Features

TRAINS is our solution to a problem we shared with countless other researchers and developers in the machine learning/deep learning universe: Training production-grade deep learning models is a glorious but messy process. TRAINS tracks and controls the process by associating code version control, research projects, performance metrics, and model provenance.

  • Start today!
    • TRAINS is free and open-source
    • TRAINS requires only two lines of code for full integration
  • Use it with your favorite tools
    • Seamless integration with leading frameworks, including: PyTorch, TensorFlow, Keras, and others coming soon
    • Support for Jupyter Notebook (see trains-jupyter-plugin) and PyCharm remote debugging (see trains-pycharm-plugin)
  • Log everything. Experiments become truly repeatable
    • Model logging with automatic association of model + code + parameters + initial weights
    • Automatically create a copy of models on centralized storage (supports shared folders, S3, GS, and Azure is coming soon!)
  • Share and collaborate
    • Multi-user process tracking and collaboration
    • Centralized server for aggregating logs, records, and general bookkeeping
  • Increase productivity
    • Comprehensive experiment comparison: code commits, initial weights, hyper-parameters and metric results
  • Order & Organization
    • Manage and organize your experiments in projects
    • Query capabilities; sort and filter experiments by results metrics
  • And more
    • Stop an experiment on a remote machine using the web-app
    • A field-tested, feature-rich SDK for your on-the-fly customization needs

TRAINS Automatically Logs

  • Git repository, branch, commit id and entry point (git diff coming soon)
    • Hyper-parameters, including
    • ArgParser for command line parameters with currently used values
    • Tensorflow Defines (absl-py)
  • Explicit parameters dictionary
  • Initial model weights file
  • Model snapshots
  • stdout and stderr
  • Tensorboard/TensorboardX scalars, metrics, histograms, images (with audio coming soon)
  • Matplotlib

See for Yourself

We have a demo server up and running at https://demoapp.trainsai.io. You can try out TRAINS and test your code with it. Note that it resets every 24 hours and all of the data is deleted.

Connect your code with TRAINS:

  1. Install TRAINS

     pip install trains
    
  2. Add the following lines to your code

     from trains import Task
     task = Task.init(project_name="my project", task_name="my task")
    
  3. Run your code. When TRAINS connects to the server, a link is printed. For example

     TRAINS Results page:
     https://demoapp.trainsai.io/projects/76e5e2d45e914f52880621fe64601e85/experiments/241f06ae0f5c4b27b8ce8b64890ce152/output/log
    
  4. Open the link and view your experiment parameters, model and tensorboard metrics

How TRAINS Works

TRAINS is a two part solution:

  1. TRAINS python package (auto-magically connects your code, see Using TRAINS)
  2. TRAINS-server for logging, querying, control and UI (Web-App)

The following diagram illustrates the interaction of the TRAINS-server and a GPU training machine using the TRAINS python package

Installing and Configuring TRAINS

  1. Install and run trains-server (see Installing the TRAINS Server)

  2. Install TRAINS package

     pip install trains
    
  3. Run the initial configuration wizard and follow the instructions to setup TRAINS package (http://trains-server ip:port and user credentials)

     trains-init
    

After installing and configuring, you can access your configuration file at ~/trains.conf

Sample configuration file available here.

Using TRAINS

Add the following two lines to the beginning of your code

from trains import Task
task = Task.init(project_name, task_name)
  • If project_name is not provided, the repository name will be used instead
  • If task_name (experiment) is not provided, the current filename will be used instead

Executing your script prints a direct link to the experiment results page, for example:

TRAINS Results page:

https://demoapp.trainsai.io/projects/76e5e2d45e914f52880621fe64601e85/experiments/241f06ae0f5c4b27b8ce8b64890ce152/output/log

For more examples and use cases, see examples.

Alt Text

Who Supports TRAINS?

TRAINS is supported by the same team behind allegro.ai, where we build deep learning pipelines and infrastructure for enterprise companies.

We built TRAINS to track and control the glorious but messy process of training production-grade deep learning models. We are committed to vigorously supporting and expanding the capabilities of TRAINS.

Why Are We Releasing TRAINS?

We believe TRAINS is ground-breaking. We wish to establish new standards of experiment management in deep-learning and ML. Only the greater community can help us do that.

We promise to always be backwardly compatible. If you start working with TRAINS today, even though this project is currently in the beta stage, your logs and data will always upgrade with you.

License

Apache License, Version 2.0 (see the LICENSE for more information)

Guidelines for Contributing

See the TRAINS Guidelines for Contributing.

FAQ

See the TRAINS FAQ.

May the force (and the goddess of learning rates) be with you!

About

TRAINS - Auto-Magical Experiment Manager & Version Control for AI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%