Liking cljdoc? Tell your friends :D

org.replikativ.foerster.hmc

Hamiltonian Monte Carlo on block sites (foerster.block), within Gibbs.

A block supplies the gradient of its log target; the move is spindel's. The momentum is drawn from the site's stream, leapfrog integrates with the block's :value+grad, and the endpoint is proposed by replaying the computation from the block site. It is accepted on the change of the FULL trace log joint plus the kinetic energy, not on the block's own value:

log α = [log p(trace') − K(p')] − [log p(trace) − K(p)]

Leapfrog is volume preserving and reversible for any position-dependent force, so the move is exact whatever the block's target covers. A block whose target misses factors its latents affect (a downstream observe, a dependent site) mixes worse, and the step says so: :incomplete-target? is true when the replay changed the log probability of anything outside the block.

Hamiltonian Monte Carlo on block sites (`foerster.block`), within Gibbs.

A block supplies the gradient of its log target; the move is spindel's. The
momentum is drawn from the site's stream, leapfrog integrates with the
block's `:value+grad`, and the endpoint is proposed by replaying the
computation from the block site. It is accepted on the change of the FULL
trace log joint plus the kinetic energy, not on the block's own value:

  log α = [log p(trace') − K(p')] − [log p(trace) − K(p)]

Leapfrog is volume preserving and reversible for any position-dependent
force, so the move is exact whatever the block's target covers. A block
whose target misses factors its latents affect (a downstream observe, a
dependent site) mixes worse, and the step says so: `:incomplete-target?`
is true when the replay changed the log probability of anything outside the
block.
raw docstring

block-site?clj/s

(block-site? trace address)

Whether the trace entry at address is a block site.

Whether the trace entry at `address` is a block site.
sourceraw docstring

hmc-stepclj/s

(hmc-step trace
          {:keys [address step-size steps iteration constraints]
           :or {step-size 0.1 steps 10 iteration 0}})

One HMC move of the block site at address of trace.

Options: :step-size, :steps (leapfrog steps), :iteration, :constraints (the chain's conditioning, as for mh-step). Returns a CPS operation resolving {:trace :accepted? :log-ratio :incomplete-target?}.

One HMC move of the block site at `address` of `trace`.

Options: `:step-size`, `:steps` (leapfrog steps), `:iteration`,
`:constraints` (the chain's conditioning, as for `mh-step`). Returns a CPS
operation resolving {:trace :accepted? :log-ratio :incomplete-target?}.
sourceraw docstring

within-gibbsclj/s

(within-gibbs {:keys [step-size steps] :as opts})

A step for foerster.trace/mh-chain (:step): an HMC move of every block site, then one single-site MH move of a latent that is not a block site, if there is one. opts: :step-size, :steps. Resolves the step with :moves (how many moves it made) and :accepted-moves; the step as a whole is :accepted? when any of them was.

A step for `foerster.trace/mh-chain` (`:step`): an HMC move of every
block site, then one single-site MH move of a latent that is not a block
site, if there is one. `opts`: `:step-size`, `:steps`. Resolves the step
with `:moves` (how many moves it made) and `:accepted-moves`; the step as a
whole is `:accepted?` when any of them was.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close