Skip to content

sagnikc395/diffusion-models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diffusion-models and normalizing-flows

CS689 — 2D Normalizing Flows and DDPM Diffusion Models Graduate Course Homework (UMass Amherst)

This repository contains the full implementation of RealNVP normalizing flows and a DDPM-style diffusion model for 2D data, following the HW5 specifications.

.
├── report_src/           # All figures, logs, analysis outputs for the report
├── code/
│   ├── realnvp.py        # RealNVP forward/inverse, coupling layers, training
│   ├── diffusion_model.py# DDPM forward q(x), posterior, ELBO training
│   ├── config.py         # Centralized hyperparameters and paths
│   └── run_me.py         # Master script: generates ALL results & figures
├── dataset/
│   └── 689_data.csv      # Provided 2D dataset
└── README.md

🚀 Setup Instructions (Using uv)

uv venv
source .venv/bin/activate
uv sync

Run the project

python code/run_me.py

This script will:

  • Q1 — RealNVP

    • Load & normalize dataset
    • Visualize point cloud
    • Build & test coupling layers
    • Train a 6-layer RealNVP model
    • Run ablations
    • Produce:
      • q1_1_scatter.png
      • q1_6_realnvp_3panel.png
      • training loss curves
      • ablation latent/sample plots
  • Q2 — DDPM

    • Sample forward noise chain q(x*L | x_0)
    • Verify posterior q(x_i | x*{i+1}, x_0)
    • Train DDPM using ELBO loss
    • Run reverse sampling to generate new data
    • Produce:
      • q2_3_xL_scatter.png
      • posterior verification figures
      • 3-panel (original / diffused / generated)
      • DDPM training loss curve

Everything is written to:

report_src

📦 Reproducibility

SEED = 42

About

Normalizing Flows and Diffusion Models made as part of CS689 HW5.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages