One table per layer. Use this when reading the paper with the code open.
Sources: code:
channels.jl,energy.jl,factors.jl,free_energy.jl,graph.jl,lens.jl,messages.jl,open_model.jlTheory (CT-ML wiki): Compact Closed Category · Dagger Category · Bayesian Inversion · Statistical Game · Bayesian Lens · Open Model · Parametric Lens · Para Construction · Variational Free Energy · Lens · Functor
Paper concept → Julia name
| AutoBayes | Lenticulum | file |
|---|---|---|
| open model | AbstractOpenModel | open_model.jl |
| latent space | the latent field of a forward result | open_model.jl |
| , a prior | AbstractBelief | open_model.jl |
| pushforward | pushforward(model, π, ps, st) | open_model.jl |
| Bayesian lens | AbstractBayesianLens | lens.jl |
| inversion | invert(lens, π, y, ps, st) | lens.jl |
| exact inversion | ExactInversion | lens.jl |
| energy (scalar) | scalar_energy(f, ...) | energy.jl |
| vector energy | energy(f, ...) | energy.jl |
| entropy | entropy(f, π, y, ...) | energy.jl |
| free energy | free_energy(f, π, y, ...) | energy.jl |
| statistical game | AbstractLenticulumFactor | statistical_game.jl |
| parameterized game | a factor + its ps from initialparameters | statistical_game.jl |
| composition | compose; or an edge in a FactorGraph | statistical_game.jl, Mycelium graph.jl |
| tensor | parallel branches in the graph | Mycelium graph.jl |
| cup / clamp | DataFactor on an Emitting edge | Mycelium factors.jl |
| prior (Remark 24) | PriorFactor | Mycelium factors.jl |
| copier | a variable node of degree > 2 | Mycelium graph.jl |
| inversion | a factor → variable message | Mycelium passing.jl |
| pushforward | a variable → factor message | Mycelium messages.jl |
| Theorem 23 on a graph | the Bethe free energy | Mycelium free_energy.jl |
| optimiser (Cruttwell §3.4) | OptimiserFactor on an exposed parameter variable | Mycelium factors.jl |
| loss + learning-rate cap (§3.2–3.3) | LossFactor (a sink) | Mycelium factors.jl |
| unobserved / observed / latent | Unobserved() / Observed() / Latent() | channels.jl |
| Definition 29 gradient composition | GradientCoupling per edge | statistical_game.jl |
| ”different semantics functors” | the GradientCoupling variants | statistical_game.jl |
The three-layer stack
┌─────────────────────────────────────────────────────────────┐
│ Lenticulum.jl — user-facing, mirrors Lux.jl │
│ concrete factors, training loops, data handling │
├─────────────────────────────────────────────────────────────┤
│ Mycelium.jl — factor graphs, message passing │
│ scheduling, polarity resolution, Bethe free energy │
├─────────────────────────────────────────────────────────────┤
│ LenticulumCore.jl — mirrors LuxCore.jl │
│ abstract types, the factor interface, energy algebra │
└─────────────────────────────────────────────────────────────┘
VariationalDiffusion.jl plugs in at the factor level
The one-sentence differences from Lux.jl
Restating README precisely now that the vocabulary exists:
- Lux layers are parametric lenses (Cruttwell et al. Def 2.5):
get+put, fixed at construction. Lenticulum factors are parameterized statistical games (AutoBayes Def 27): a lens plus an energy plus an entropy, and the lens is assembled on demand once a polarity is chosen. Hence - Lux wiring is a DAG; Lenticulum’s is any weakly-connected digraph, licensed by compact closure. Factors still use Lux internally.
- Message passing is trivial in Lux (there is one order). In Lenticulum it must be scheduled, and dense all-pairs passing should be sparsified for performance. This is also what the paper’s closing discussion asks for: belief propagation / variational message passing to approximate the pushforward priors.
Reading order for the code
channels.jl— what a factor’s ports are, and what polarity means.energy.jl— the two energies and the scalarisation algebra.open_model.jl— kernels with latent spaces, pushforward.lens.jl— pairing a model with an inversion.statistical_game.jl— the factor interface, tying it together.
Then Mycelium, in this order:
graph.jl— the bipartite structure and the two acyclicity notions (Factor Graphs).polarity_resolution.jl— which way to run a factor (Polarity Resolution).passing.jl— the five lines where a message becomes an inversion (Messages are Inversions).free_energy.jl— Theorem 23 on a graph (Bethe Free Energy).factors.jl— data, losses and optimisers as nodes (Everything is a Factor).
Related: Lux as a Parametric Lens, Factors are Parameterized Statistical Games, Scalar and Multivariate Energy, LenticulumCore