Key
A JAX PRNG key is an explicit value representing pseudorandom state that is passed to random operations for reproducible results.
Deep Learning with JAX
A JAX pseudorandom-number-generator key passed explicitly to random functions for functional and reproducible randomness.
- How it is used
- Supports explicit, reproducible randomness for sampling, augmentation, initialization, dropout, simulations, and parallel computation.
- How deep it goes
- Explains creation, reuse, splitting, fold-in, state representation, and sequential-equivalence limits, but not PRNG internals beyond a two-integer array.
- Examples
- Uses Gaussian noise, noisy images, horizontal flips, random augmentation choices, split subkeys, and fold_in-derived keys.
- What you can do after
- Apply it via jax.random to generate reproducible values and manage independent random operations in transformed JAX functions.
Deep Learning with Python, Third Edition
A JAX random-state value passed explicitly to PRNG operations to generate deterministic random numbers without global state.
- How it is used
- Manages random state explicitly in stateless JAX operations without relying on a global PRNG state.
- How deep it goes
- Demonstrates key creation, reuse, and deterministic splitting, without detailing PRNG internals.
- Examples
- Shows repeated normal samples from one key and a different sample from a split key.
- What you can do after
- Apply it using JAX to generate reproducible random samples and derive keys for different samples.
Read how Deep Learning with Python, Third Edition explains key →
Deep Learning with R, Third Edition
A PRNG key is an explicit data object that identifies the deterministic state used by a pseudo-random number generation operation.
- How it is used
- Uses explicit keys to manage randomness without global state in JAX operations.
- How deep it goes
- Defines key creation, explicit passing, deterministic reuse, and splitting, but does not descend into key internals.
- Examples
- Demonstrates JAX normal sampling with a seed key, repeated-key reuse, and deterministic key splitting.
- What you can do after
- Apply it via JAX to reproduce random values and derive new deterministic random states.
What to know first
- gradientA gradient is the vector of partial derivatives of a scalar function with respect to its variables, indicating its local rate and direction of change.
- stateState is information describing the condition or configuration of a system or computation at a particular time that may influence its behavior or subsequent transitions.
- arrayAn array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
Related concepts
- JAXused by · JAX is a Python library for high-performance array computing, with composable transformations for automatic differentiation, compilation, vectorization, and parallelization.
- init()used by · The Linen method that initializes a Module's variables, including parameters, from dummy inputs and a PRNG key.
- random seeduses · A random seed is a value that initializes a pseudorandom process and determines its subsequent sequence of outputs.
- jax.random.normal()used by · jax.random.normal() is a JAX function that generates normally distributed pseudorandom values using an explicit PRNG key and output shape.
- jax.random.splitproduced by · jax.random.split() is a JAX function that deterministically derives one or more new pseudorandom-number generator keys from an existing key.
- data augmentationused by · Data augmentation is the process of adding to or transforming data to increase its variety or usefulness for learning, computation, or analysis.
Questions about key
What is key?
A JAX PRNG key is an explicit value representing pseudorandom state that is passed to random operations for reproducible results.
Which Manning books explain key?
Deep Learning with JAX, Deep Learning with Python, Third Edition and Deep Learning with R, Third Edition.
What should I know before learning key?
Manning books that teach key usually introduce gradient, state and array first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


