load_checkpoint

jaxrens.io.checkpoint.load_checkpoint(path)[source]

Load NS state from HDF5 checkpoint.

Handles checkpoints written by any of the three run variants: run_ns (scalar fields), run_ns_parallel (1-D), and run_ns_multi_gpu (2-D (G, P)).

The returned log_evidence has whatever shape was stored. Call state["log_evidence"].shape to infer the batch configuration.

Dead-array padding is only applied for scalar (single-run) checkpoints where n_dead is a plain integer. For batched checkpoints the full stored arrays are returned as-is.

All array fields — including rng_key_data — are returned as numpy.ndarray (not jax.Array) so this function does not import or touch jax. Restart-path callers that need a typed PRNG Key re-wrap with jax.random.wrap_key_data(...) themselves (see init/restart.py); the wrapping must happen there, not here, to keep headless postprocess paths jax-free.

Returns:

NS state dict compatible with ns_step / run_ns and variants. state["rng_key_data"] is the raw uint32 buffer when the checkpoint persisted one (current format), or None for legacy checkpoints that pre-date the save.

Parameters:

path (Path | str)

Return type:

dict