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
- Supplies explicit random state to JAX PRNG operations instead of relying on a global generator.
- How deep it goes
- Explains creation, reuse, and deterministic splitting with code, but does not examine PRNG internals.
- Examples
- Shows repeated `random.normal()` calls returning identical arrays, then a split key producing different values.
- What you can do after
- Apply it via `jax.random.key()`, `jax.random.normal()`, and `jax.random.split()` to produce repeatable random values without global state.
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.
Related concepts
- JAXused by · JAX is a Python library for high-performance array-based numerical computing with composable transformations including 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 an initial value used to initialize a pseudorandom process and determine 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 or deriving examples, variables, or associated information from existing data to increase its variety or support subsequent analysis or computation.
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.


