Key Concepts — JAX documentation
The default array implementation in JAX is jax.Array. In many ways it is similar to the numpy.ndarray type that you may be familar with from the NumPy package, but it has some important differences. We typically don’t call the jax.Array constructor directly, but rather create arrays via JAX API functions. For example, jax.numpy provides familar NumPy-style array construction functionality such as jax.numpy.zeros(), jax.numpy.linspace(), jax.numpy.arange(), etc. If you use Python type annotations in your code, jax.Array is the appropriate annotation for jax array objects (see jax.typing for more discussion). JAX Array objects have a devices method that lets you inspect where the contents of the array are stored. In the simplest cases, this will be a single CPU device: In general, an array may be sharded across multiple devices, in a manner that can be inspected via the sharding attribute: Here the array is on a single device, but in general a JAX array can be sharded across multiple dev
Key concepts # This section briefly introduces some key concepts of the JAX package. Transformations # Along with functions to operate on arrays, JAX includes a number of transformations which operate on JAX functions. These include jax.jit() : Just-in-time (JIT) compilation; see Just-in-time compilation jax.vmap() : Vectorizing transform; see Automatic vectorization jax.grad() : Gradient transform; see Automatic differentiation as well as several others. Transformations accept a function as an argument, and return a new transformed function. For example, here’s how you might JIT-compile a sim
Explore this link on the map →related reading
- Quickstart: How to think in JAX — JAX documentationjax.readthedocs.io
- GitHub - jax-ml/jax: Composable transformations of Python+NumPy programs: differentiate, vectorize, JIT to GPU/TPU, and more · GitHubgithub.com
- 🔪 JAX - The Sharp Bits 🔪 — JAX documentationjax.readthedocs.io
- Why You Should (or Shouldn't) be Using Google's JAX in 2023assemblyai.com
- jax.Array — JAX documentationjax.readthedocs.io
- JAX As Accelerated NumPy — JAX documentationjax.readthedocs.io
- Why You Should (or Shouldn't) be Using Google's JAX in 2023assemblyai.com
- Just-in-time compilation — JAX documentationjax.readthedocs.io
- Frequently asked questions (FAQ) — JAX documentationjax.readthedocs.io
- Introduction to debugging — JAX documentationjax.readthedocs.io
- Build a Transformer in JAX from scratch: how to write and train your own models | AI Summertheaisummer.com
- Just In Time Compilation with JAX — JAX documentationjax.readthedocs.io