You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 0.3.0: inference-first — likelihoods as programs, optimizer mode, Pareto posterior, prior-owned encodings
Closes the three caveats left by the 0.2.0 refactor, completing the
"implementation of fugue for running evolutionary algorithms as Bayesian
inference" identity:
Fix A — likelihoods as programs (inference/likelihood.rs):
- GenomeLikelihood<G>: observation program p(data|g) with observes, factors,
and latent nuisance parameters jointly inferred with the genome.
- tempered_observe helper; FactorFitness adapter (black-box mode = explicit
Gibbs/generalized-Bayes posterior); NoLikelihood; MemoizedFitness
(exact-key shared cache).
- EvolutionModel<P, L> generalization; new(prior, fitness) still works via
FactorFitness; from_likelihood accepts any observation program.
- GaussianRegression with NoiseSpec::Infer: observation noise as a latent
site, posterior read off particle traces (test recovers sigma=0.3).
Fix B1 — optimizer mode: EvolutionSMC::anneal continues the tempering
ladder past beta=1 (fugue primitives only: incremental reweight, normalize,
resample, rejuvenate, optional crossover sweep), concentrating on optima
with uncertainty attached. Head-to-head example vs SimpleGA.
Fix B2 — multi-objective as inference (inference/pareto.rs):
ParetoScalarization puts the scalarization weight inside the model
(uniform-simplex stick-breaking), so the posterior marginal traces the
Pareto front; particle_weights locates each particle on it. Analytic
biobjective validation (Pareto set [0,2], x*(w) = 2(1-w)).
Fix C — prior-owned encodings: GenomePrior::trace_of (grammar prior
overrides with the exact inverse of its generative walk; pinned by
inversion + hand-computed PCFG score tests); score/to_weighted_trace work
for grammar trees; EvolutionChain::init_from warm-starts from any genome.
Fix B3 — identity: `classic` feature gates the EC toolkit
(MultiObjectiveFitness moved to core fitness::multi_objective); std,ppl
builds inference standalone; std,parallel,checkpoint,classic builds classic
fugue-free; README/description lead with the inference identity.
All 9 suites green in default config; both minimal configs check clean;
clippy/fmt clean; wasm unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmWLBR9Zq6hPG5o7URDuNJ
* Fix refactor-induced broken intra-doc links (rustdoc now warning-free)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmWLBR9Zq6hPG5o7URDuNJ
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,10 @@ fugue-evo is a **two-layer** evolutionary-computation library:
44
44
45
45
-`EvolutionaryGenome` (src/genome/traits.rs): the classic, fugue-free genome trait (decode/dimension/generate/distance).
46
46
-`TraceGenome` (src/genome/trace_genome.rs, `ppl`): extension trait adding `to_trace`/`from_trace`/`trace_prefix` — the boundary into the inference layer. `Permutation` uses a Lehmer-code (rank) encoding so single-site MH moves stay valid.
47
-
-`GenomePrior` (src/inference/prior.rs): a prior as a program — `fn model(&self) -> fugue::Model<G>` returning the decoded genome. Built-ins: `UniformBoxPrior`, `GaussianPrior`, `BitStringPrior`, `PermutationPrior`, `ArithmeticGrammarPrior`.
47
+
-`GenomePrior` (src/inference/prior.rs): a prior as a program — `fn model(&self) -> fugue::Model<G>` returning the decoded genome, plus `trace_of` (encode a genome under the prior's address scheme; grammar prior overrides it). Built-ins: `UniformBoxPrior`, `GaussianPrior`, `BitStringPrior`, `PermutationPrior`, `ArithmeticGrammarPrior`.
48
+
-`GenomeLikelihood` (src/inference/likelihood.rs): an observation program `p(data|g)` — observes, factors, latent nuisance sites (jointly inferred). `FactorFitness` is the black-box Gibbs-posterior adapter; `MemoizedFitness` caches expensive evaluations.
49
+
- Optimizer mode: `EvolutionSMC::anneal` tempers past beta=1. Multi-objective: `ParetoScalarization` (src/inference/pareto.rs) — scalarization weight as a latent site; posterior traces the Pareto front.
50
+
- Feature matrix: `classic` gates the EC toolkit; `ppl` gates inference; each builds without the other (`std,ppl` and `std,parallel,checkpoint,classic` are both CI-relevant configs).
Copy file name to clipboardExpand all lines: Cargo.toml
+43-5Lines changed: 43 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,10 @@ lto = true
12
12
13
13
[package]
14
14
name = "fugue-evo"
15
-
version = "0.2.0"
15
+
version = "0.3.0"
16
16
edition = "2021"
17
17
authors = ["Alex Nodeland"]
18
-
description = "Evolutionary computation for Rust: classical EC algorithms plus evolutionary inference - evolutionary algorithms as probabilistic programs (tempered SMC in trace space, built on fugue-ppl)"
18
+
description = "An implementation of fugue for running evolutionary algorithms as Bayesian inference: priors and likelihoods as probabilistic programs, tempered SMC in trace space, annealed optimization, Pareto posteriors - plus a standalone classical EC toolkit"
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
# Fugue Evo
6
6
7
-
**Two layers: classical evolutionary algorithms (standalone), and evolutionary inference — evolutionary algorithms *as* probabilistic programs (tempered SMC in trace space, built on [Fugue](https://github.com/alexnodeland/fugue))**
7
+
**An implementation of [Fugue](https://github.com/alexnodeland/fugue) for running evolutionary algorithms as Bayesian inference — priors and likelihoods as probabilistic programs, tempered SMC in trace space — plus a standalone classical EC toolkit**
8
8
9
9
*Populations hunting real landscapes, live in your browser: every figure in the docs at [evo.fugue.run](https://evo.fugue.run) runs the actual crate, compiled to WASM.*
10
10
@@ -16,10 +16,14 @@
16
16
17
17
</div>
18
18
19
-
An evolutionary-computation library for Rust with an architectural split that keeps both halves honest:
19
+
fugue-evo runs evolution as inference. The prior over genomes is a user-written fugue `Model<G>` (a `GenomePrior`); the data enter through a `GenomeLikelihood` — an *observation program* that may contain per-datum `observe` statements, latent nuisance parameters (e.g. an unknown noise scale, jointly inferred with the genome), or a black-box `factor(β·f(x))` (the classical Gibbs-posterior mode). The target `π_β(x) ∝ p(x)·p(data|x)^β`**is a fugue program**, and every sampler is fugue's own inference machinery:
20
20
21
-
-**Classic EC (no fugue dependency).** SimpleGA, CMA-ES, NSGA-II, Island Model, Evolution Strategy, EDA/UMDA, SteadyState, all operators, checkpointing, and the WASM surface. Build with `--no-default-features --features std,parallel,checkpoint` and there is no probabilistic-programming dependency at all.
22
-
-**Evolutionary inference (`ppl` feature, on by default): evolutionary algorithms *as* probabilistic programs.** The prior over genomes is a user-written fugue `Model<G>` (a `GenomePrior`), fitness enters as `factor(β·f(x))`, so the Boltzmann posterior `π_β(x) ∝ p(x)·exp(β·f(x))`**is a fugue program** — and every sampler is fugue's own inference machinery: `EvolutionChain` (typed single-site MH), `EvolutionSMC` (adaptive tempered SMC with a population-coupled crossover kernel and an unbiased log-evidence estimate), and `ArithmeticGrammarPrior` (genetic programming over a probabilistic grammar, where subtree mutation and crossover are generic trace moves). See `examples/symbolic_regression_inference.rs` — symbolic regression as exact Bayesian inference.
21
+
-**`EvolutionChain`** — typed single-site MH (every site kind moves: reals, bits, permutation ranks, tree structure with automatic reversible-jump corrections), warm-startable from any genome via `init_from`.
22
+
-**`EvolutionSMC`** — adaptive tempered SMC with a population-coupled crossover kernel, decode-replay genome recovery, and an unbiased **log-evidence** estimate for Bayesian model comparison. `EvolutionSMC::anneal` keeps tempering past β = 1 for **optimizer mode** — a principled single-objective optimizer with uncertainty attached.
23
+
-**`ArithmeticGrammarPrior`** — genetic programming over a probabilistic grammar: subtree mutation and crossover are generic trace moves. `examples/symbolic_regression_inference.rs` does symbolic regression as exact Bayesian inference.
24
+
-**`ParetoScalarization`** — multi-objective optimization as inference: the scalarization weight is a latent model site, so the posterior marginal *traces the Pareto front* and each particle knows where on the front it lives.
25
+
26
+
The **classic EC toolkit** (`classic` feature, on by default) — SimpleGA, CMA-ES, NSGA-II, Island Model, ES, EDA/UMDA, operators, checkpointing, the WASM surface — remains fully standalone: build with `--no-default-features --features std,parallel,checkpoint,classic` and there is no probabilistic-programming dependency at all. Conversely, `--features std,ppl` builds the inference layer with no classic EC code. CMA-ES and NSGA-II are deliberately *not* reframed as inference (CMA-ES is not a posterior sampler); they serve as baselines.
0 commit comments