liveBook · Manning

Key

As explained in 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.

A PRNG key is an explicit data object identifying the deterministic state used by a pseudo-random operation. JAX passes it explicitly instead of relying on global seed state. section 3.5.3

Create and reuse a key

Create a key with jax$random$key(123L), then pass it as the first argument to jax$random$normal(). Reusing the same key produces the same value each time. section 3.5.3

Split a key for new randomness

Use jax$random$split(seed_key, num = 1L)@py[0] to derive a new key. The split is deterministic, so the same sequence of splits produces the same resulting key. section 3.5.3

How Deep Learning with R, Third Edition covers it

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.
How it connects
Connects PRNG keys with random number generation, global seed state, statelessness, determinism, and vectorization.

Also explained in

Compare how 3 books explain key →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.