ishitta-iyer/research-diffusion

★ 0Forks 0Jupyter NotebookGitHub ↗Compare

README

Manuscript in prep

Scale-dependent memorization in diffusion models

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.

Repository layout

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

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Run notebooks from the repository root so imports and output paths resolve consistently.

Experiments

The main workflow is:

  1. Reproduce the two-rectangle experiment from Baptista et al.
  2. Generate multiband Matérn fields and match their geometry to the rectangle data.
  3. Train SongUNet models on the rescaled fields.
  4. Measure memorization in coarse, intermediate, and fine Fourier bands.
  5. Compare unregularized, isotropic, and covariance-weighted models.
  6. 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.

Metric conventions

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

Tests

python3 src/tests/test_consolidation.py
python3 src/tests/test_songunet_parity.py

Reference

This work builds on Baptista, Dasgupta, Kovachki, Oberai, and Stuart, Memorization and Regularization in Generative Diffusion Models, and the accompanying DiffusionModelDynamics repository.

Contributors

ishitta-iyer

Issues