reference

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.jl

Theory (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

AutoBayesLenticulumfile
open model AbstractOpenModelopen_model.jl
latent space the latent field of a forward resultopen_model.jl
, a priorAbstractBeliefopen_model.jl
pushforward pushforward(model, π, ps, st)open_model.jl
Bayesian lens AbstractBayesianLenslens.jl
inversion invert(lens, π, y, ps, st)lens.jl
exact inversion ExactInversionlens.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 AbstractLenticulumFactorstatistical_game.jl
parameterized game a factor + its ps from initialparametersstatistical_game.jl
composition compose; or an edge in a FactorGraphstatistical_game.jl, Mycelium graph.jl
tensor parallel branches in the graphMycelium graph.jl
cup / clampDataFactor on an Emitting edgeMycelium factors.jl
prior (Remark 24)PriorFactorMycelium factors.jl
copiera variable node of degree > 2Mycelium graph.jl
inversion a factor → variable messageMycelium passing.jl
pushforward a variable → factor messageMycelium messages.jl
Theorem 23 on a graphthe Bethe free energyMycelium free_energy.jl
optimiser (Cruttwell §3.4)OptimiserFactor on an exposed parameter variableMycelium factors.jl
loss + learning-rate cap (§3.2–3.3)LossFactor (a sink)Mycelium factors.jl
unobserved / observed / latentUnobserved() / Observed() / Latent()channels.jl
Definition 29 gradient compositionGradientCoupling per edgestatistical_game.jl
”different semantics functors”the GradientCoupling variantsstatistical_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:

  1. 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
  2. Lux wiring is a DAG; Lenticulum’s is any weakly-connected digraph, licensed by compact closure. Factors still use Lux internally.
  3. 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

  1. channels.jl — what a factor’s ports are, and what polarity means.
  2. energy.jl — the two energies and the scalarisation algebra.
  3. open_model.jl — kernels with latent spaces, pushforward.
  4. lens.jl — pairing a model with an inversion.
  5. statistical_game.jl — the factor interface, tying it together.

Then Mycelium, in this order:

  1. graph.jl — the bipartite structure and the two acyclicity notions (Factor Graphs).
  2. polarity_resolution.jl — which way to run a factor (Polarity Resolution).
  3. passing.jl — the five lines where a message becomes an inversion (Messages are Inversions).
  4. free_energy.jl — Theorem 23 on a graph (Bethe Free Energy).
  5. 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