jexplore.steps.step#

This module define the jexplore.steps.step.Step class which is the base class for all steps.

Classes#

Step

This is the base step definition class. It provides a generic epoch initialization

Module Contents#

class Step[Tepoch: jexplore.sampling.Epoch, Tstate: jexplore.sampling.State, Tsampling: jexplore.sampling.Sampling][source]#

This is the base step definition class. It provides a generic epoch initialization method builder, some general methods and a placeholder for the step method.

epoch: Tepoch#

current epoch

sampling: Tsampling#

sampling parameters

abstract step(key, state)[source]#

Step sampling method. This is just a prototype.

Parameters:
  • key (jax.Array) – PRNG key

  • state (Tstate) – current state

Returns:

new state and the boolean mask of the chains modified by the step.

Return type:

tuple[Tstate, jax.Array]

build(epoch)[source]#

Epoch initialisation method.

Parameters:

epoch (Tepoch) – current epoch.

Return type:

None

builder(epoch)[source]#

This method updates the step object state according to the current epoch, calling the build method, and returning the pointer to the step method. In principle this base implementation is general and does not need to be overridden or extended (rather extend the build method).

Parameters:

epoch (Tepoch) – epoch.

Returns:

pointer to this class step method.

Return type:

jexplore.sampling.StepSample[Tstate]

static get_accepted(key, logacc)[source]#

Given a set of log acceptance values, draws a correspondng set of log uniform values and returns the acceptance mask.

Parameters:
  • key (jax.Array) – PRNG key

  • logacc (jax.Array) – set of log acceptance values

Returns:

new PNRG key and acceptance mask.

Return type:

tuple[jax.Array, jax.Array]