Extending Sequince

Extending Sequince#

Extend a pipeline with custom steps to update the particle population or perform work within an iteration. Use callbacks to inspect completed iterations, report progress, update run metadata, or request a stop.

  • Custom steps explains the step interface, returning updated state and context, and recording diagnostics in the result. It includes an example that records the particle mean.

  • Custom callbacks explains the callback interface and returning context updates. It includes examples that report progress or stop a run.

Before implementing a component, review particle state and step context to decide where its data belongs. Stochastic steps should use the runner’s generator as described in Random number generation.

For components that will run inside a compiled JAX iteration, also follow the functional step contract and initialization requirements in JAX and functional execution. See Configuring an SMC runner for assembling the components into a pipeline.