Skip to content

tsim.sampler.sample_program

← Module overview

functionsample_programsource

tsim.sampler.sample_program

Signature
def sample_program(program: CompiledProgram, f_params: jax.Array, key: PRNGKey) -> jax.Array

Sample all outputs from a compiled program.

Parameters

NameTypeDescription
programCompiledProgramThe compiled program to sample from.
f_paramsjax.ArrayError parameters, shape (batch_size, num_f_params).
keyPRNGKeyJAX random key.

Returns

(jax.Array, jax.Array)Samples array of shape (batch_size, num_outputs), reordered to match the original output indices.

source