Skip to content

Fisher divergence, mutual information (MINE), tempered transitions - #42

Merged
davidkhjo merged 6 commits into
mainfrom
research-eval-tempering
Aug 16, 2026
Merged

davidkhjo merged 6 commits into
mainfrom
research-eval-tempering

Conversation

@davidkhjo

Copy link
Copy Markdown
Owner

Fisher divergence, mutual information (MINE), tempered transitions

The research-tail of the expansion — three independently-useful additions, each with a closed-form or distributional test.

  • eval.fisher_divergence(energy_a, energy_b, x) — E‖s_a − s_b‖², a score-space distance between two EBMs (no partition function). Test: matches the two-Gaussian closed form tr(MΣ₁Mᵀ)+‖b(μ₁−μ₂)‖² (0.864 vs 0.873); identical models → 0.
  • eval.mutual_information(x, y) — MINE (Belghazi et al. 2018): a small statistics net maximizing the Donsker–Varadhan bound, marginals by in-batch shuffling. Test: recovers Gaussian MI −½log(1−ρ²) within 0.05. Example mine_mutual_information.py tracks the closed form across a ρ sweep.
  • TemperedTransitions — Neal's (1996) single-chain annealed barrier crossing: melt one chain up a temperature ladder and refreeze, with the telescoping log-weight and one accept/reject. A replica-free complement to ParallelTempering. Test: recovers an asymmetric 70/30 mixture's weights from a fully trapped start (0.30, not 0.5) where single-chain MALA stays at 0.005 — which pins the acceptance sign, since a symmetric target can't.

No version bump — lands under the unreleased 0.13.0 CHANGELOG section.

Verification

ruff + format + mypy clean; 151 tests pass; example runs on CPU.

🤖 Generated with Claude Code

fisher_divergence: E‖s_a - s_b‖² between two EBMs' scores (exact vs the
two-Gaussian closed form). mutual_information: MINE's Donsker-Varadhan bound via
a small trained statistics net (validated against -½log(1-ρ²)). Both torch-only.
Single-chain barrier crossing: anneal one chain up a temperature ladder to a
freely-mixing hot distribution and back, accumulating Neal's telescoping
log-weight for a single end-of-move accept/reject. Complements ParallelTempering
without replicas; reuses the _Tempered helper.
@davidkhjo
davidkhjo merged commit 23db5ac into main Aug 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant