Code Monkey home page Code Monkey logo

trax's Introduction

Trax — your path to advanced deep learning

train tracks PyPI version GitHub Issues Contributions welcome License Gitter

Trax helps you understand and explore advanced deep learning. We focus on making Trax code clear while pushing advanced models like Reformer to their limits. Trax is actively used and maintained in the Google Brain team. Give it a try, talk to us or open an issue if needed.

Use Trax

You can use Trax either as a library from your own python scripts and notebooks or as a binary from the shell, which can be more convenient for training large models. Trax includes a number of deep learning models (ResNet, Transformer, RNNs, ...) and has bindings to a large number of deep learning datasets, including Tensor2Tensor and TensorFlow datasets. It runs without any changes on CPUs, GPUs and TPUs.

To see how to use Trax as a library, take a look at this quick start colab which explains how to create data in python, connect it to a Transformer model in Trax, train it and run inference. You can select a CPU or GPU runtime, or even get a free 8-core TPU as runtime. With TPUs in colab you need to set extra flags as demonstrated in these training and inference colabs.

To use Trax as a binary and not forget all the parameters (model type, learning rate, other hyper-paramters and training settings), we recommend gin-config. Take a look at an example gin config for training a simple MLP on MNIST and run it as follows:

python -m trax.trainer --config_file=$PWD/trax/configs/mlp_mnist.gin

As a more advanced example, you can train a Reformer on Imagenet64 to generate images like this with the following command:

python -m trax.trainer --config_file=$PWD/trax/configs/reformer_imagenet64.gin

Structure

Trax code is structured in a way that allows you to understand deep learning from scratch. We start with basic maths and go through layers, models, supervised and reinforcement learning. We get to advanced deep learning results, including recent papers such as Reformer - The Efficient Transformer, selected for oral presentation at ICLR 2020.

The main steps needed to understand deep learning correspond to sub-directories in Trax code:

  • math/ — basic math operations and ways to accelerate them on GPUs and TPUs (through JAX and TensorFlow)
  • layers/ are the basic building blocks of neural networks and here you'll find how they are build and all the needed ones
  • models/ contains all basic models (MLP, ResNet, Transformer, ...) and a number of new research models
  • optimizers/ is a directory with optimizers needed for deep learning
  • supervised/ contains the utilities needed to run supervised learning and the Trainer class
  • rl/ contains our work on reinforcement learning

Development

To get the most recent update on Trax development, chat with us.

Most common supervised learning models in Trax are running and should have clear code — if this is not the case, please open an issue or, even better, send along a pull request (see our contribution doc). In Trax we value documentation, examples and colabs so if you find any problems with those, please report it and contribute a solution.

We are still improving a few smaller parts of layers, planning to update the supervised API and heavily working on the rl part, so expect these parts to change over the next few months. We are also working hard to improve our documentation and examples and we welcome help with that.

trax's People

Contributors

afrozenator avatar cclauss avatar cool-rr avatar friesel avatar fsx950223 avatar henrykmichalewski avatar j2i2 avatar jaingaurav avatar jekbradbury avatar koz4k avatar koz4k2 avatar lkhphuc avatar modyharshit23 avatar pkol avatar pzielinski-nyc avatar trax-robot avatar wangpengmit avatar

Watchers

 avatar  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.