MCMC diagnostics + ensemble uncertainty: plots, EnsembleEnergy, disagreement OOD - #53
Merged
Conversation
EnsembleEnergy pools members into a MEAN energy (the geometric-mean density, distinct from MixtureEnergy's logsumexp), with member_energies and a per-sample disagreement (variance across members). eval.ensemble_disagreement exposes that variance batched as an epistemic OOD score. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
viz.autocorrelation_plot (with a +/-1.96/sqrt(N) band), rank_plot (Vehtari rank histograms), and trace_plot, backed by the numeric eval.autocorrelation. Reuse the ESS FFT-autocovariance and _as_chains coercion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ensemble reproduces the closed-form combined Gaussian variance and its disagreement separates OOD at AUROC ~1; the ACF estimator matches an AR(1)'s rho^t; rank-plot uniformity for matched chains and skew for an offset chain. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A 3-member deep-ensemble EBM whose member disagreement flags OOD (two-moons vs a Gaussian blob, AUROC ~1). README eval/composition/viz rows + examples list and the unreleased CHANGELOG updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two threads that make EBMs easier to trust: is the sampler mixing? and is this input in-distribution?
Diagnostics
eval.autocorrelation(samples, max_lag)— mean per-chain ACF ρ̂_t (FFT, the same autocovariance aseffective_sample_size).viz.autocorrelation_plot(with a ±1.96/√N band),viz.rank_plot(Vehtari rank histograms — uniform under good mixing),viz.trace_plot.Ensemble uncertainty
EnsembleEnergy— a deep-ensemble mean energyE = (1/N)ΣE_i(the geometric-mean density; equalsSumEnergywith weights 1/N), deliberately distinct fromMixtureEnergy's logsumexp. Addsmember_energiesanddisagreement(per-sample variance across members).eval.ensemble_disagreement— that variance, batched, as an epistemic OOD score.Validation (closed-form / distributional)
ρ^t(to N-error).1/mean(1/σ_i²)exactly.Notes
ensemble_ood.py: a 3-member ensemble on two-moons; disagreement flags a Gaussian blob at AUROC ≈ 1.🤖 Generated with Claude Code