Sequential core-set Monte Carlo (Beronov, Weilbach, Wood & Campbell, UAI 2021): SMC over data arriving in batches whose rejuvenation moves cost a bounded amount however much data has arrived.
The target after t batches is p_t(θ) ∝ p₀(θ) · Π_{s≤t} Π_b p(x_b⁽ˢ⁾ | θ).
Plain resample-move SMC (IBIS; Chopin 2002) must score every past datum in
each move, so step t costs O(t). SCMC keeps at most :memory M past data
points with weights — a core-set — whose weighted log-likelihood
approximates that of all data so far, and moves the particles against
log p₀(θ) + Σ_j w_j log p(u_j | θ).
After each step's moves, when the core-set and the new batch exceed M, it is recompressed: a sparse nonnegative least-squares fit (GIGA; Campbell & Broderick 2018) of the core-set's log-likelihood functions, centred and evaluated at the current particles, to their weighted sum. The fit is best where the population has its mass.
The reweighting by each new batch is exact. Only the moves target the
core-set approximation, so the particles carry its error: small when the
log-likelihoods compress well (exchangeable data, few parameters), larger
for a small :memory. With M at least the amount of data, SCMC is
resample-move SMC.
The engine is foerster.population/theta-smc on θ vectors: a step
resamples, then moves every particle by population-scaled random-walk
Metropolis.
Sequential core-set Monte Carlo (Beronov, Weilbach, Wood & Campbell, UAI
2021): SMC over data arriving in batches whose rejuvenation moves cost a
bounded amount however much data has arrived.
The target after t batches is p_t(θ) ∝ p₀(θ) · Π_{s≤t} Π_b p(x_b⁽ˢ⁾ | θ).
Plain resample-move SMC (IBIS; Chopin 2002) must score every past datum in
each move, so step t costs O(t). SCMC keeps at most `:memory` M past data
points with weights — a core-set — whose weighted log-likelihood
approximates that of all data so far, and moves the particles against
log p₀(θ) + Σ_j w_j log p(u_j | θ).
After each step's moves, when the core-set and the new batch exceed M, it
is recompressed: a sparse nonnegative least-squares fit (GIGA; Campbell &
Broderick 2018) of the core-set's log-likelihood functions, centred and
evaluated at the current particles, to their weighted sum. The fit is best
where the population has its mass.
The reweighting by each new batch is exact. Only the moves target the
core-set approximation, so the particles carry its error: small when the
log-likelihoods compress well (exchangeable data, few parameters), larger
for a small `:memory`. With M at least the amount of data, SCMC is
resample-move SMC.
The engine is `foerster.population/theta-smc` on θ vectors: a step
resamples, then moves every particle by population-scaled random-walk
Metropolis.(append-batch {:keys [particles memory scale seed coreset steps model
compressed?]
:as state}
batch)Advance a persistent SCMC state by one non-empty batch. The old state remains reusable. Retains only the population and a bounded coreset; the caller owns any observation history needed for replay or correction. :last-update reports ESS before resampling, not convergence or accuracy. Historical replacement/retraction is not an append operation.
Advance a persistent SCMC state by one non-empty batch. The old state remains reusable. Retains only the population and a bounded coreset; the caller owns any observation history needed for replay or correction. :last-update reports ESS before resampling, not convergence or accuracy. Historical replacement/retraction is not an append operation.
(giga ls target m)Greedy iterative geodesic ascent (Campbell & Broderick 2018, Alg. 1):
nonnegative weights w over the vectors ls (double arrays of one length),
at most m of them nonzero, with Σ w_n·ls_n close to target.
It works on the unit sphere: each iteration adds the vector whose geodesic from the current direction best aligns with the geodesic to the target's direction, with the step that maximizes the alignment; the weights are scaled optimally at the end. A vector of norm 0 gets weight 0. Returns the weights as a vector.
Greedy iterative geodesic ascent (Campbell & Broderick 2018, Alg. 1): nonnegative weights w over the vectors `ls` (double arrays of one length), at most `m` of them nonzero, with Σ w_n·ls_n close to `target`. It works on the unit sphere: each iteration adds the vector whose geodesic from the current direction best aligns with the geodesic to the target's direction, with the step that maximizes the alignment; the weights are scaled optimally at the end. A vector of norm 0 gets weight 0. Returns the weights as a vector.
(result {:keys [particles approximate?] :as state})Project an SCMC snapshot to the common settled measure API. Projection does not consume the snapshot. Coreset moves and population adaptation do not certify an unbiased normalizer or posterior convergence.
Project an SCMC snapshot to the common settled measure API. Projection does not consume the snapshot. Coreset moves and population adaptation do not certify an unbiased normalizer or posterior convergence.
(scmc {:keys [batches] :as model} & [opts])Run numeric SCMC over :batches using start, append-batch and result. model: :prior-sample (fn [] theta-vector), :prior-log-density (fn [theta]), :log-lik (fn [theta datum]), :batches (lazy sequence of non-empty batches). opts: :particles (1000), :memory (100), :scale (2.38), :seed. Returns an EmpiricalMeasure with :coreset, :steps, :max-coreset-size, :moves, :accepted, :last-update and :log-normalizer. Streaming memory is bounded by population, coreset and batch; no history of updates is retained. To pause between batches, retain the state returned by append-batch.
Run numeric SCMC over :batches using start, append-batch and result. model: :prior-sample (fn [] theta-vector), :prior-log-density (fn [theta]), :log-lik (fn [theta datum]), :batches (lazy sequence of non-empty batches). opts: :particles (1000), :memory (100), :scale (2.38), :seed. Returns an EmpiricalMeasure with :coreset, :steps, :max-coreset-size, :moves, :accepted, :last-update and :log-normalizer. Streaming memory is bounded by population, coreset and batch; no history of updates is retained. To pause between batches, retain the state returned by append-batch.
(start {:keys [prior-sample] :as model}
&
[{:keys [particles memory scale seed]
:or {particles 1000 memory 100 scale 2.38}}])Initialize resumable numeric SCMC. model provides :prior-sample, :prior-log-density and :log-lik. State is a persistent in-memory value, including model functions; it is not a serialized inference artifact. opts: :particles (1000), :memory (100), :scale (2.38), :seed.
Initialize resumable numeric SCMC. model provides :prior-sample, :prior-log-density and :log-lik. State is a persistent in-memory value, including model functions; it is not a serialized inference artifact. opts: :particles (1000), :memory (100), :scale (2.38), :seed.
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 |