Liking cljdoc? Tell your friends :D

org.replikativ.foerster.process

Memoization and random processes whose state lives in the particle's world, so it forks with the particle and is discarded with it — Anglican's mem and its Chinese restaurant process, on spindel worlds.

mem turns a spin-returning function into one that computes each argument list once per world: the first call samples, later calls (in the same particle, and in every particle forked after it) return that value. Nonparametric models are written with it, as a stick per index or a mean per cluster:

(let [mean-of (process/mem (fn [k] (spin (sample (dist/normal 0 10) :id [:mean k]))))] (spin … (await (mean-of 3)) …))

Name the sample sites inside a memoized function by its arguments, as above: a value is drawn once, at the first call.

crp-draw seats a customer in a Chinese restaurant process: table k with probability ∝ its customers, a new table ∝ α. The tables live in the world under the process's name; the draw is an ordinary sample site over the existing tables and a new one, so every method — exact enumeration included — handles it.

Memoization and random processes whose state lives in the particle's
world, so it forks with the particle and is discarded with it — Anglican's
`mem` and its Chinese restaurant process, on spindel worlds.

`mem` turns a spin-returning function into one that computes each
argument list once per world: the first call samples, later calls (in the
same particle, and in every particle forked after it) return that value.
Nonparametric models are written with it, as a stick per index or a
mean per cluster:

  (let [mean-of (process/mem (fn [k] (spin (sample (dist/normal 0 10) :id [:mean k]))))]
    (spin … (await (mean-of 3)) …))

Name the sample sites inside a memoized function by its arguments, as
above: a value is drawn once, at the first call.

`crp-draw` seats a customer in a Chinese restaurant process: table k with
probability ∝ its customers, a new table ∝ α. The tables live in the world
under the process's name; the draw is an ordinary sample site over the
existing tables and a new one, so every method — exact enumeration
included — handles it.
raw docstring

bp__org.replikativ.foerster.effects_SLASH_chooseclj

source

bp__org.replikativ.foerster.effects_SLASH_deterministicclj

source

bp__org.replikativ.foerster.effects_SLASH_factorclj

source

bp__org.replikativ.foerster.effects_SLASH_observeclj

source

bp__org.replikativ.foerster.effects_SLASH_sampleclj

source

bp__org.replikativ.spindel.effects.await_SLASH_awaitclj

source

bp__org.replikativ.spindel.effects.await_SLASH_await_finalizationclj

source

bp__org.replikativ.spindel.effects.savepoint_SLASH_savepointclj

source

bp__org.replikativ.spindel.effects.track_SLASH_trackclj

source

crp-drawclj/s

(crp-draw name alpha & {:keys [id]})

Seat a customer in the Chinese restaurant process name with concentration alpha > 0: a spin resolving the table index, an existing table k with probability ∝ its customers, a new table (index = the number of tables) ∝ α. :id names the sample site.

Seat a customer in the Chinese restaurant process `name` with
concentration `alpha` > 0: a spin resolving the table index, an existing
table k with probability ∝ its customers, a new table (index = the number
of tables) ∝ α. `:id` names the sample site.
sourceraw docstring

crp-tablesclj/s

(crp-tables name)

The customers at each table of the process name in the current world: a vector, table k at index k.

The customers at each table of the process `name` in the current world:
a vector, table k at index k.
sourceraw docstring

memclj/s

(mem f)

f (a function returning a spin or a value) memoized per world: each argument list is computed once in a particle, and particles forked later share what was computed before the fork. Returns a function of the same arguments returning a spin.

`f` (a function returning a spin or a value) memoized per world: each
argument list is computed once in a particle, and particles forked later
share what was computed before the fork. Returns a function of the same
arguments returning a spin.
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