Skip to content

feat(empf): add e-means-inspired Exponential Moving Prototype Flow trainer family and Forge CUDA qualification - #541

Open
martyn wants to merge 2 commits into
developfrom
feat/empf-family
Open

martyn wants to merge 2 commits into
developfrom
feat/empf-family

Conversation

@martyn

@martyn martyn commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements EMPF (Exponential Moving Prototype Flow) (particlegan/empf.py, particlegan/_empf/), a standalone ParticleGAN trainer family (critic_formulation="empf", prior_regularizer="empf", preset "empf") inspired by e-means (Bessa et al., arXiv:2611.09501), together with its full Forge CUDA qualification (empf-v1), 9-family DCGAN scaling campaign, and current leaderboard publication.

DEFAULT_RECIPE = "bispf_optimized" and all historical receipts, snapshots, and incumbent recipe digests remain untouched.

Formulation Overview (critic_formulation="empf", prior_regularizer="empf")

  1. Online (S, N) Sufficient-Statistics Prototype Bank (particlegan/_empf/prototypes.py):
    • Replaces noisy raw real-minibatch Sinkhorn endpoints with persistent prototype sums and effective counts (S_k, N_k) updated via a clock-free (K, B) hit-rate EMA (alpha = clip(alpha_base * (B / K)^0.45, 0.03, 0.35)), dropping dataset-size and epoch-horizon clocks.
    • Deterministic proportional-split dead-prototype revival: When N_k < revival_tau * mean(N), splits an active donor selected via golden/plastic (phi_1, phi_2) quasi-Monte Carlo CDF sampling while conserving exact total mass ((N_donor + N_dead) / 2) with zero RNG consumption.
  2. Mass-Weighted Prototype-to-Fake Entropic Sinkhorn Chords (particlegan/_empf/transport.py, penalty.py):
    • Solves scale-free log-domain Sinkhorn with non-uniform prototype row marginals w_k = N_k / sum_j N_j against uniform generated column marginals 1 / B_f in $O(B \cdot K)$ rather than $O(B^2 \cdot D_{\text{img}})$, preserving rare-mode transport mass while preserving exact row-aligned fiber pairing on conditioned inputs.
    • Pairs prototype-chord EBI directional gradient capping, zero-mean logit gauge (gamma_gauge), and state-driven smoothstep thermal cooling (EMPFStepRecord, serialized across checkpoints with zero module-level global state).
  3. Latent Prior Regularizer with Differentiable Dead-Particle Revival (particlegan/_empf/prior.py):
    • Combines an initial-moment covariance tether, scale-free $k$-NN log-repulsion, a short-range one-sided discrete codebook non-collision hinge (N <= min_dof), and a smooth dead-particle revival tether (d_{1\text{nn}}^2 / (isolation_ratio * r_{\text{med}}^2) - 1) pulling stranded outlier particles back to active clusters.

Forge CUDA Readout (empf-v1, Seed 0, NVIDIA RTX A6000)

Executed commit: cb5e484b059d3474f7259c40beb7acb4b5bb8704 (readout-d46a41a1da2da54d67d154f4.json, 40 attempts, 0 INCOMPLETE, 1109/1109 attempt coverage):

Selected Recipe / Family Tier 1 (27) Tier 2 (78) Tier 3 (10) Total View Reqs (115) Full-Suite 61 PASS Tuning Budget
BISPF (bispf-optimized-quintic-v1) 22/27 (4 not run) 55/78 (4 not run) 4/10 81/115 18 19 cards
EMPF (empf-v1, new) 27/27 48/78 0/10 (3 blocked) 75/115 20 untuned (1 card, 0 searches)
BCAP (recipe-prior-refactor-bcap-pure-v1) 22/27 (4 not run) 49/78 (4 not run) 0/10 71/115 16 85 searches / 473 cards
GAN v3 / K3P / KA2 / R1-R2 20/27 (4 not run) 0/78 0/10 20/115 5 8–46 cards (tuned)
Atlas (atlas-particle-normal-v4) 18/27 0/78 0/10 18/115 8 5 cards
E22 (e22) 0/27 0/78 0/10 0/115 0 untuned (1 card)

Disclosure: BISPF and BCAP pinned snapshots predate the 4 newer VAE/AE Tier 1 tasks (4 not run).

Key Scientific Findings

  • 11/11 Required Tier 1 PASS (27/27 Tier 1 view requirements) + Clock-Free Audit PASS (clockfree_audit_measurement_v1, 4/4 parity comparisons): Passes two_pole, gaussian1d_smoke, zero_tanh_smoke, ring16_acquisition, five_word_joint_smoke, ae_gan_hold, unused_token_hold, model_ae_gan_multimodal, model_ae_reconstruction, model_vae_categorical, and model_vae_hard.
  • Rare-Mode Preservation (vector_unequal_mass): Mass-weighted Sinkhorn (w_k = N_k / sum_j N_j) retains 2.98% mass (122/4096) on the 2% rare mode with component_core_min_eigen_ratio = 0.0595 (15× BISPF's 0.004 and 6.6× BCAP's 0.009).
  • DCGAN Scaling Throughput (dcgan-performance-cloud-1acd41cb5f4a, NVIDIA RTX A6000): Fastest update throughput and lowest high-res peak VRAM across all 9 families at B64, 128², and 256²:
    • 64², B64, W64: 39.19 ms (1,628.56 img/s) vs BISPF 90.24 ms (710.67 img/s, 2.3×) and BCAP 674.06 ms (95.20 img/s, 17.1×).
    • 256², B16, W64: 156.88 ms (102.03 img/s, 1,522 MiB) vs BISPF 342.33 ms (46.72 img/s, 2,119 MiB, 2.2× faster / 28% less VRAM).
  • Clear Structural Bottlenecks for EMPF v2:
    1. grid100 / rotated100 / staggered100: K_max = 64 < 100 target modes coarsens fine 10×10 lattice centers (center_max_sigma ~ 1.72–2.15).
    2. gaussian1d_stability & mode_hold (hq=0.8411 vs 0.90): stationary EMA inertia lags abrupt target shifts and loses 3 of 8 modes over long holds.
    3. model_ddgan_gaussian_chain / model_ae_ddgan_gaussian_chain: unconditioned prototype pooling over concatenated transition pairs [x_t, x_{t+1}] blurs conditional transition fibers.

Verification

  • python scripts/check_lint.py — 0 new findings
  • python ops/refresh_forge_readouts.py --check --reports-only — CURRENT (stale stages: none)
  • uv build — wheel 401,152 bytes (< 600,000 limit)
  • pytest — test_empf.py, test_refresh_forge_readouts.py, test_forge_comparison_policy.py, test_forge_trainer_families.py, test_core_inventory_legacy_documentation.py, test_recipe_defaults.py all passing

This branch has not been deployed

No deployments
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