One population-path interpreter over representation-specific batch phases. Value phases may complete synchronously and contain fused numeric loops; trace phases may suspend. Both use the same weighting/selection/retention.
One population-path interpreter over representation-specific batch phases. Value phases may complete synchronously and contain fused numeric loops; trace phases may suspend. Both use the same weighting/selection/retention.
(moved population particles)A cardinality-preserving invariant population move retains its weights.
A cardinality-preserving invariant population move retains its weights.
(retain population chains retain-initial?)Retain a chain per parent, optionally including its initial state. Split each parent's normalized mass among its outputs; uniform equal-length chains retain canonical uniform weights (the waste-free SMC case).
Retain a chain per parent, optionally including its initial state. Split each parent's normalized mass among its outputs; uniform equal-length chains retain canonical uniform weights (the waste-free SMC case).
(run initial
path
backend
{:keys [n waste-free seed keys max-steps positions? step-offset]
:or {max-steps 1000 positions? true step-offset 0}})CPS interpreter. initial has :particles/:mass/:position. path has :done?, :advance [particles normalized-log-weights position] -> {:pos :log-incr}, and :exhausted. backend :move [starts position step moves] returns CPS resolving {:chains [states-per-parent] :seen [...]}; optional :select [particles indices] and :reclaim [old seen live] are CPS batch operations. opts controls :n, :waste-free, :seed, :keys {:resample role}, :max-steps and :positions?. :step-offset continues global RNG step indices across resumed segments; :max-steps still bounds the number of steps in this invocation.
CPS interpreter. initial has :particles/:mass/:position. path has :done?,
:advance [particles normalized-log-weights position] -> {:pos :log-incr}, and
:exhausted. backend :move [starts position step moves] returns CPS resolving
{:chains [states-per-parent] :seen [...]}; optional :select [particles indices]
and :reclaim [old seen live] are CPS batch operations. opts controls :n,
:waste-free, :seed, :keys {:resample role}, :max-steps and :positions?.
:step-offset continues global RNG step indices across resumed segments;
:max-steps still bounds the number of steps in this invocation.(run-sync operation)Execute a known synchronous backend without blocking. Drive a returned Partial-CPS Thunk even under an enclosing trampoline; reject true suspension.
Execute a known synchronous backend without blocking. Drive a returned Partial-CPS Thunk even under an enclosing trampoline; reject true suspension.
(selection-plan population n {:keys [method seed key] :or {method :systematic}})Statistical selection only. Representation ownership/copy follows selected. Normalized weights are reset while total mass is retained.
Statistical selection only. Representation ownership/copy follows selected. Normalized weights are reset while total mass is retained.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |