All Projects → gordicaleksa → get-started-with-JAX

gordicaleksa / get-started-with-JAX

Licence: MIT License
The purpose of this repo is to make it easy to get started with JAX, Flax, and Haiku. It contains my "Machine Learning with JAX" series of tutorials (YouTube videos and Jupyter Notebooks) as well as the content I found useful while learning about the JAX ecosystem.

Programming Languages

Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to get-started-with-JAX

omd
JAX code for the paper "Control-Oriented Model-Based Reinforcement Learning with Implicit Differentiation"
Stars: ✭ 43 (-81.22%)
Mutual labels:  flax, haiku, jax
uvadlc notebooks
Repository of Jupyter notebook tutorials for teaching the Deep Learning Course at the University of Amsterdam (MSc AI), Fall 2022/Spring 2022
Stars: ✭ 901 (+293.45%)
Mutual labels:  flax, jax, optax
Opendatawrangling
공공데이터 분석
Stars: ✭ 148 (-35.37%)
Mutual labels:  jupyter, numpy
Cheatsheets.pdf
📚 Various cheatsheets in PDF
Stars: ✭ 159 (-30.57%)
Mutual labels:  jupyter, numpy
Py
Repository to store sample python programs for python learning
Stars: ✭ 4,154 (+1713.97%)
Mutual labels:  jupyter, numpy
Skydetector
A Python implementation of Sky Region Detection in a Single Image for Autonomous Ground Robot Navigation (Shen and Wang, 2013)
Stars: ✭ 23 (-89.96%)
Mutual labels:  jupyter, numpy
Machinelearningcourse
A collection of notebooks of my Machine Learning class written in python 3
Stars: ✭ 35 (-84.72%)
Mutual labels:  jupyter, numpy
Alphalens
Performance analysis of predictive (alpha) stock factors
Stars: ✭ 2,130 (+830.13%)
Mutual labels:  jupyter, numpy
efficientnet-jax
EfficientNet, MobileNetV3, MobileNetV2, MixNet, etc in JAX w/ Flax Linen and Objax
Stars: ✭ 114 (-50.22%)
Mutual labels:  flax, jax
jax-models
Unofficial JAX implementations of deep learning research papers
Stars: ✭ 108 (-52.84%)
Mutual labels:  flax, jax
Datasets
TFDS is a collection of datasets ready to use with TensorFlow, Jax, ...
Stars: ✭ 3,094 (+1251.09%)
Mutual labels:  numpy, jax
koclip
KoCLIP: Korean port of OpenAI CLIP, in Flax
Stars: ✭ 80 (-65.07%)
Mutual labels:  flax, jax
Einops
Deep learning operations reinvented (for pytorch, tensorflow, jax and others)
Stars: ✭ 4,022 (+1656.33%)
Mutual labels:  numpy, jax
Ncar Python Tutorial
Numerical & Scientific Computing with Python Tutorial
Stars: ✭ 50 (-78.17%)
Mutual labels:  jupyter, numpy
Trax
Trax — Deep Learning with Clear Code and Speed
Stars: ✭ 6,666 (+2810.92%)
Mutual labels:  numpy, jax
SymJAX
Documentation:
Stars: ✭ 103 (-55.02%)
Mutual labels:  numpy, jax
Pyprobml
Python code for "Machine learning: a probabilistic perspective" (2nd edition)
Stars: ✭ 4,197 (+1732.75%)
Mutual labels:  flax, jax
Transformers
🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
Stars: ✭ 55,742 (+24241.48%)
Mutual labels:  flax, jax
jax-rl
JAX implementations of core Deep RL algorithms
Stars: ✭ 61 (-73.36%)
Mutual labels:  flax, jax
chef-transformer
Chef Transformer 🍲 .
Stars: ✭ 29 (-87.34%)
Mutual labels:  flax, jax

Get started with JAX! 💻

The goal of this repo is to make it easier to get started with JAX, Flax, and Haiku!

JAX ecosystem is becoming an increasingly popular alternative to PyTorch and TensorFlow. 😎





Note: I'm only going to recommend content that I've personally analyzed and found useful here. If you want a comprehensive list check out the awesome-jax repo.

Table of Contents

My Machine Learning with JAX Tutorials

Tip on how to use notebooks: just open the notebook directly in Google Colab (you'll see a button on top of the Jupyter file which will direct you to Colab). This way you can avoid having to setup the Python env! (This was especially convenient for me since I'm on Windows which is still not supported)

Tutorial #1: From Zero to Hero

In this video, we start from the basics and then gradually dig into the nitty-gritty details of jit, grad, vmap, and various other idiosyncrasies of JAX.

YouTube Video (Tutorial #1)
Accompanying Jupyter Notebook

JAX from zero to hero!

Tutorial #2: From Hero to HeroPro+

In this video, we learn all additional components needed to train ML models (such as NNs) on multiple machines! We'll train a simple MLP model and we'll even train an ML model on 8 TPU cores!

YouTube Video (Tutorial #2)
Accompanying Jupyter Notebook

JAX from Hero to HeroPro+!

Tutorial #3: Building a Neural Network from Scratch

Watch me code a Neural Network from scratch! 🥳 In this 3rd video of the JAX tutorials series.

In this video, I build an MLP and train it as a classifier on MNIST using PyTorch's data loader (although it's trivial to use a more complex dataset) - all this in "pure" JAX (no Flax/Haiku/Optax).

I then do an additional analysis:

  • Visualize MLP's learned weights
  • Visualize embeddings of a batch of images using t-SNE
  • Finally, I analyze whether we have too many dead ReLU neurons in our network

YouTube Video (Tutorial #3)
Accompanying Jupyter Notebook (Note: I'll soon refactor it but I'll link the original)

Building a Neural Network from Scratch in pure JAX!


Tutorial #4: Machine Learning with Flax - From Zero to Hero

In this video, I cover everything you need to know to get started with Flax!

We cover init, apply, TrainState, etc. and other idiosyncrasies like the usage of mutable and rngs keywords.

YouTube Video (Tutorial #4)
Accompanying Jupyter Notebook

Flax from Zero to Hero!


Tutorial #5 (coming up): Machine Learning with Haiku - From Zero to Hero

todo

Other useful content

Aside from the official docs here are some resources that helped me.

Videos

Blogs

Acknowledgements

  • The notebooks were heavily inspired by the official JAX, Flax, and Haiku docs.

Citation

If you find this content useful, please cite the following:

@misc{Gordic2021GetStartedWithJAX,
  author = {Gordić, Aleksa},
  title = {Get started with JAX},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/gordicaleksa/get-started-with-JAX}},
}

Connect With Me

If you'd love to have some more AI-related content in your life 🤓, consider:

Licence

License: MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].