Canonical worlds for inference that runs several times (:world-policy :fork): one frozen fork of the caller's world per inference, from which
every run (a particle-MCMC sweep, an IPMCMC node, a BBVI iteration, a
Markov chain, a tempered-SMC particle, an inference program) forks a world
and scope of its own; the scope's cleanup, its recovery capability, and
the wallet arithmetic of :authority. See doc/worlds.md.
Canonical worlds for inference that runs several times (`:world-policy :fork`): one frozen fork of the caller's world per inference, from which every run (a particle-MCMC sweep, an IPMCMC node, a BBVI iteration, a Markov chain, a tempered-SMC particle, an inference program) forks a world and scope of its own; the scope's cleanup, its recovery capability, and the wallet arithmetic of `:authority`. See doc/worlds.md.
Versioned inference cursors: pushes and forks cannot overwrite a waiter or consume a later observation through an old step. Close is controller-wide.
Versioned inference cursors: pushes and forks cannot overwrite a waiter or consume a later observation through an old step. Close is controller-wide.
Shared execution of independent CPS operations. Fail-fast rejection does not cancel/join children; their owning inference scope supplies that lifetime.
Shared execution of independent CPS operations. Fail-fast rejection does not cancel/join children; their owning inference scope supplies that lifetime.
Gen's generative function interface over savepoint traces.
Each operation is spindel.trace/run or replay under a policy of
foerster.runtime.trace; what this namespace adds is the weight each operation
returns and the discard of update, with Gen's identities (Cusumano-Towner
et al. 2019, q the model's internal proposal, here the prior):
generate(c) w = log p(t) − log q(t; c) = Σ log p of constrained and observed sites assess(choices) w = log p(choices) = the log joint update(t, c) w = log p(t') − log p(t) − log q(fresh choices of t') regenerate(t, s) w = log p(t')/p(t) + log q(t | t')/q(t' | t)
so importance sampling is generate, and MH with a selection is
regenerate accepted on its weight. A model is a spin whose sample sites
are named with :id (or addressed structurally, see addressing/site-address!);
constraints are keyed by those addresses.
Every operation returns a CPS operation (fn [resolve reject]).
simulate, generate and assess run in a root world and savepoint session
of their own (a session runs one computation, and a world hosts one
session); the worlds live until close!.
update and regenerate replay inside the session of the trace they are
given and leave that trace intact: the caller keeps one of the two and gives
the other back with spindel.trace/release!.
Gen's generative function interface over savepoint traces. Each operation is `spindel.trace/run` or `replay` under a policy of `foerster.runtime.trace`; what this namespace adds is the weight each operation returns and the discard of `update`, with Gen's identities (Cusumano-Towner et al. 2019, q the model's internal proposal, here the prior): generate(c) w = log p(t) − log q(t; c) = Σ log p of constrained and observed sites assess(choices) w = log p(choices) = the log joint update(t, c) w = log p(t') − log p(t) − log q(fresh choices of t') regenerate(t, s) w = log p(t')/p(t) + log q(t | t')/q(t' | t) so importance sampling is `generate`, and MH with a selection is `regenerate` accepted on its weight. A model is a spin whose sample sites are named with `:id` (or addressed structurally, see `addressing/site-address!`); constraints are keyed by those addresses. Every operation returns a CPS operation `(fn [resolve reject])`. `simulate`, `generate` and `assess` run in a root world and savepoint session of their own (a session runs one computation, and a world hosts one session); the worlds live until `close!`. `update` and `regenerate` replay inside the session of the trace they are given and leave that trace intact: the caller keeps one of the two and gives the other back with `spindel.trace/release!`.
An asynchronous lifetime for inference resources. Acquisitions register before execution starts; close joins acquisitions and attempts every release.
An asynchronous lifetime for inference resources. Acquisitions register before execution starts; close joins acquisitions and attempts every release.
Probabilistic programs as traced computations.
sample, observe and factor publish savepoints (sites
:inference/choose and :inference/factor), so a probabilistic program is
run and replayed by spindel.trace like any other computation. This
namespace adds what is specific to inference and nothing else: a policy that
scores, pure functions over scored traces, and Metropolis-Hastings as replay
plus an accept step.
Every entry's :note carries
:dist the site's distribution (nil for a factor) :log-prob log density of the entry's value under :dist, for EVERY site, sampled ones included (a factor's weight) :log-proposal log density under whatever drew the value; absent when the value was not drawn (observed, constrained, kept) :observed? :constrained? :kept? :symmetric? :factor?
A deterministic site is recorded with {:deterministic? true} only; it is
not among entries, so it neither scores nor moves.
and the world accumulates the importance weight at [:inference :log-weight]: log p of what was observed, constrained or factored, and
log p - log q of what a proposal drew. A policy writes it to the world it
is about to resume, so the weight of a fork starts from the weight at its
site.
Probabilistic programs as traced computations.
`sample`, `observe` and `factor` publish savepoints (sites
`:inference/choose` and `:inference/factor`), so a probabilistic program is
run and replayed by `spindel.trace` like any other computation. This
namespace adds what is specific to inference and nothing else: a policy that
scores, pure functions over scored traces, and Metropolis-Hastings as replay
plus an accept step.
Every entry's `:note` carries
:dist the site's distribution (nil for a factor)
:log-prob log density of the entry's value under :dist, for EVERY
site, sampled ones included (a factor's weight)
:log-proposal log density under whatever drew the value; absent when the
value was not drawn (observed, constrained, kept)
:observed? :constrained? :kept? :symmetric? :factor?
A `deterministic` site is recorded with `{:deterministic? true}` only; it is
not among `entries`, so it neither scores nor moves.
and the world accumulates the importance weight at `[:inference
:log-weight]`: `log p` of what was observed, constrained or factored, and
`log p - log q` of what a proposal drew. A policy writes it to the world it
is about to resume, so the weight of a fork starts from the weight at its
site.Reachability reclamation for complete trace populations sharing anchors.
Reachability reclamation for complete trace populations sharing anchors.
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 |