Coder Social home page Coder Social logo

jax's Introduction

Welcome to the JAX Repository

JAX is a combination of Automatic Differentiation and XLA (Accelerated Linear ALgebra). XLA is a compiler developed by Google to work on TPU units. Autograd and XLA are brought together by JAX to accelerate ML research by enabling high-speed numerical computing. JAX's highlights include Python-Numpy code base, ease of Differentiating complex functions, Vectorization, Parallelzation, and Just-In-Time (jit) compilation.

JAX is basically a python library, just like Tensorflow and Pytorch but a bit different, I would not compare the three as is, however this should get you more comfortable around learning JAX. There is another library called FLAX (from Google Research team) which is built on top of it, and you can draw parallels to Keras being built on top of Tensorflow.

JAX Loves Numpy. Its API is very much like Numpy. It work on all accelerators - CPU, GPU, and TPUs.

Like numpy, JAX has arrays too, but two things, one they are called instead Device Arrays and two, they are Immutable. ALso, JAX is not stateful, this would imply that if you are generating random numbers you will have to pass the random state explicitly and not implicitly unlike it happen in Python Numpy. Device Arrays means that these arrays lie on your devices - CPU, GPU, and TPU. These devices are also called accelerators.

JAX has something called Asynchronus Dispatch System in the background. What it does is that it immedaitely delegates a computation task on device arrays to the Accelerator as soon as it is typed in, it doesn't even wait for it to excute. This is tricky as well as very useful feature which we need to keep in mind while programming using JAX. One solution is to use block_until_ready() while assiging an output of a calculation to a variable.

JAX uses XLA to optimize your ML code using cool compiler tricks and the programmer doesn't have to worry about it. When you cast your function as Just-in-time or to say when you Jit your functions they at times become order of magnitude faster, thus giving you performance benefits.

Automatic differentiation makes JAX the most exciting library for deep learning practitioners. Derivatives are integral part of back propagation which in turn is integral to the learning process of neural networks. This is done using grad() fnction in JAX.

Please refer the following Colab Notebooks for detailed explanations and Code on my github repsitory here -

jax's People

Contributors

yvrjsharma avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

techthiyanes

jax's Issues

A little propose๐Ÿ“„

Thank you for writing such beautiful documents!

If the situation allows, I hope you can include some comparisons with PyTorch or Tensorflow in the same scenario. This would be an immense blessing for JAX beginners.

Looking forward to the next!
๐Ÿš€

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.