This repository studies memorization and regularization in score-based diffusion models using multiband Matérn random fields. The experiments track nearest-neighbour memorization across Fourier bands and compare isotropic and covariance-weighted Tikhonov regularization.
The learned-model experiments use SongUNet with EDM preconditioning. Closed-form Gaussian mixture models provide exact-score controls.
src/ models, training utilities, data generation, and metrics
src/tests/ regression and upstream-parity tests
notebooks/multiscale/ experiments and analysis
results/figures/ selected result figures
results/data/ local experiment artifacts ignored by Git
notes/ local research notes and plotting scripts
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtRun notebooks from the repository root so imports and output paths resolve consistently.
The main workflow is:
- Reproduce the two-rectangle experiment from Baptista et al.
- Generate multiband Matérn fields and match their geometry to the rectangle data.
- Train SongUNet models on the rescaled fields.
- Measure memorization in coarse, intermediate, and fine Fourier bands.
- Compare unregularized, isotropic, and covariance-weighted models.
- Repeat the comparison across training-set sizes.
The active notebooks are in notebooks/multiscale/. Model weights, checkpoints, and generated
data are written under results/data/ and are not committed.
- Exclude the nearest neighbour from the random-reference pool.
- Aggregate with the mean of per-reference error ratios.
- Use bands
(0.5, 4),(4, 10),(10, 18), and(18, 32). - For training-size comparisons, compute a separate held-out baseline at each size.
python3 src/tests/test_consolidation.py
python3 src/tests/test_songunet_parity.pyThis work builds on Baptista, Dasgupta, Kovachki, Oberai, and Stuart, Memorization and Regularization in Generative Diffusion Models, and the accompanying DiffusionModelDynamics repository.