Programmable weighted inference using ordinary Spin control flow. Targets share a representation and a fixed state space. Custom scores/proposals and invariant value transitions have explicit mathematical obligations; a result does not automatically certify an unbiased likelihood estimator.
Programmable weighted inference using ordinary Spin control flow. Targets share a representation and a fixed state space. Custom scores/proposals and invariant value transitions have explicit mathematical obligations; a result does not automatically certify an unbiased likelihood estimator.
(advance scope population target)Reweight in the same state space. A trace population version is consumed; target adaptation needs its own statistical justification.
Reweight in the same state space. A trace population version is consumed; target adaptation needs its own statistical justification.
(finish scope population)Project to the shared settled measure API. run joins resource cleanup before delivery. Live trace handles are consumed; numeric value snapshots persist.
Project to the shared settled measure API. run joins resource cleanup before delivery. Live trace handles are consumed; numeric value snapshots persist.
(fork scope population)Copy a live population with independent future random streams. The source remains usable. Trace copies share read-only anchors under the owner scope.
Copy a live population with independent future random streams. The source remains usable. Trace copies share read-only anchors under the owner scope.
(initialize scope target n)(initialize scope target n {:keys [id] :as opts})Initialize an independent population. Optional :id names its logical RNG stream for concurrent programs; a name may be used once per scope. Default identities follow sequential initialization order.
Initialize an independent population. Optional :id names its logical RNG stream for concurrent programs; a name may be used once per scope. Default identities follow sequential initialization order.
(invariant-kernel target step)Bind a value transition to a target. step receives a value and returns a value. The author must establish invariance and fixed tuning independent of the population being moved and the offspring slot; this constructor does not prove either property.
Bind a value transition to a target. step receives a value and returns a value. The author must establish invariance and fixed tuning independent of the population being moved and the offspring slot; this constructor does not prove either property.
(copy-particles representation scope target particles ancestors opts)(initialize-particles representation scope target n opts)(move-particles representation scope target particles kernel opts)(project-particle representation target particle)(transport-particles representation source destination particles kernel opts)(resample scope population)(resample scope
population
{:keys [particles method] :or {method :systematic} :as opts})(retarget target position score)Derive a value target in the same state space. Position is a label, not target identity. Changing support requires a valid proposal/transport construction. Trace targets must use temperature, not arbitrary scores.
Derive a value target in the same state space. Position is a label, not target identity. Changing support requires a valid proposal/transport construction. Trace targets must use temperature, not arbitrary scores.
(run body)(run opts body)Run (body scope) with a root seed and an asynchronous resource lifetime. Scope is passed explicitly; nested programs receive independent lifetimes.
Run (body scope) with a root seed and an asynchronous resource lifetime. Scope is passed explicitly; nested programs receive independent lifetimes.
(trace-target model
&
[{:keys [beta executor label world-policy]
:or {beta 0.0 world-policy :fresh}
:as opts}])A complete-trace target p(choices)*L(choices)^beta, not a streaming prefix. Only fresh worlds are supported here. Model effects obey the Spin discipline.
A complete-trace target p(choices)*L(choices)^beta, not a streaming prefix. Only fresh worlds are supported here. Model effects obey the Spin discipline.
(transport scope population destination kernel)Propose and reweight through scored forward/backward laws. Unlike move, this operation can change targets and value dimension; weights are corrected.
Propose and reweight through scored forward/backward laws. Unlike move, this operation can change targets and value dimension; weights are corrected.
(value-target
score
draw
log-proposal
&
[{:keys [label project copy] :or {project identity copy identity} :as opts}])A target over persistent values. draw and log-proposal must describe the same normalized proposal, covering the target's support. score is the log unnormalized target, including any constants needed for evidence.
A target over persistent values. draw and log-proposal must describe the same normalized proposal, covering the target's support. score is the log unnormalized target, including any constants needed for evidence.
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 |