View source on GitHub
|
JAX implementation of the RNGHandler using explicit key splitting.
meridian.backend.RNGHandler(
seed: SeedType
)
Args | |
|---|---|
seed
|
The initial seed, which must be a Python integer, a sequence of two integers, a scalar integer Tensor/array, or None. |
Raises | |
|---|---|
ValueError
|
If the provided seed is invalid. |
Methods
advance_handler
advance_handler() -> '_JaxRNGHandler'
Creates a new, independent RNGHandler for a subsequent operation.
This method is used to generate a new handler derived deterministically from the current handler's state.
| Returns | |
|---|---|
A new, independent RNGHandler instance.
|
get_kernel_seed
get_kernel_seed() -> Any
Provides a backend-appropriate sanitized seed/key for an MCMC kernel.
This method exposes the current state of the handler in the format expected by the backend's MCMC machinery. It does not advance the internal state.
| Returns | |
|---|---|
| A backend-specific seed object (e.g., a JAX PRNGKey or a TF Tensor). |
get_next_seed
get_next_seed() -> Any
Provides the appropriate seed object for the next sequential operation.
This is primarily used for prior sampling and typically advances the internal state.
| Returns | |
|---|---|
| A backend-specific seed object for a single random operation. |
View source on GitHub