Skip to content

maxheitzman/Generative-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generative AI Course - CS 4331/5331

Author: Max Heitzman
Semester: Fall 2025
Course: CS 4331/5331 - Generative AI

📋 Course Overview

This repository contains all assignments and projects from the Generative AI course, covering fundamental and advanced generative modeling techniques. Each assignment builds upon previous concepts, progressing from basic architectures to state-of-the-art models.

🎯 Course Topics Covered

  1. UNet Architectures - Encoder-decoder networks with skip connections
  2. Variational Autoencoders (VAE) - Probabilistic generative models with latent spaces
  3. Generative Adversarial Networks (GAN) - Adversarial training for generation
  4. Diffusion Models (DDPM) - Denoising diffusion probabilistic models
  5. DCGAN with Label Smoothing - Advanced GAN training techniques

📁 Repository Structure

Generative AI/
├── README.md              # This file
├── A1/                   # Assignment 1: UNet Implementation
│   ├── README.md
│   └── HW1_GenAI25 (2) 2/
│       ├── 1D_UNet.py
│       └── 2D_UNet.py
├── A2/                   # Assignment 2: Variational Autoencoders
│   ├── README.md
│   └── Heitzman_HW2/
│       ├── VAE.py
│       ├── train.py
│       └── [experiments]
├── A3/                   # Assignment 3: Generative Adversarial Networks
│   ├── README.md
│   └── HW3_GenAI25/
│       ├── GAN.py
│       ├── train.py
│       └── [experiments]
├── A4/                   # Assignment 4: Diffusion Models
│   ├── README.md
│   └── diffusion_homework/
│       ├── UNet_time.py
│       ├── train_mnist.py
│       └── [models and results]
└── Project/             # Final Project: DCGAN with Label Smoothing
    ├── README.md
    └── Presenation /
        ├── code/
        │   ├── baseline_dcgan.py
        │   ├── smoothed_dcgan.py
        │   └── train.py
        └── [experiments and results]

📚 Assignments

Assignment 1: UNet Architecture

Topic: Implementing 1D and 2D UNet architectures from scratch

Key Concepts:

  • Encoder-decoder architecture
  • Skip connections
  • Downsampling/upsampling with einops
  • Time conditioning for diffusion models

See: A1/README.md

Assignment 2: Variational Autoencoders

Topic: Building and training VAEs on MNIST

Key Concepts:

  • Variational inference
  • ELBO objective
  • Reparameterization trick
  • Latent space analysis (t-SNE, traversal)

See: A2/README.md

Assignment 3: Generative Adversarial Networks

Topic: Implementing 2D GANs with different data distributions

Key Concepts:

  • Adversarial training
  • Minimax game formulation
  • Training dynamics and stability
  • Mode collapse

See: A3/README.md

Assignment 4: Diffusion Models

Topic: Denoising Diffusion Probabilistic Models (DDPM) on MNIST

Key Concepts:

  • Forward and reverse diffusion processes
  • Noise schedules (linear, cosine)
  • Time-conditional UNet
  • Sampling from diffusion models

See: A4/README.md

🎓 Final Project

DCGAN Label Smoothing Exploration

Topic: Investigating how label smoothing affects DCGAN training on CIFAR-10

Research Question: Does label smoothing improve DCGAN training stability and image quality?

Methodology:

  • Implement baseline DCGAN with hard labels (1.0/0.0)
  • Implement smoothed DCGAN with soft labels (0.9/0.1)
  • Compare training dynamics, loss curves, and generated images
  • Analyze stability metrics

See: Project/README.md

🔧 Technologies & Tools

  • Python 3.8+
  • PyTorch - Deep learning framework
  • NumPy - Numerical computing
  • Matplotlib - Visualization
  • einops - Tensor manipulation
  • t-SNE - Dimensionality reduction
  • CUDA - GPU acceleration (when available)

📊 Datasets Used

  • MNIST - Handwritten digits (28×28 grayscale)
  • CIFAR-10 - Natural images (32×32 color, 10 classes)

🎯 Learning Progression

  1. UNet → Understanding encoder-decoder architectures
  2. VAE → Probabilistic generative models, latent spaces
  3. GAN → Adversarial training, minimax optimization
  4. Diffusion → State-of-the-art generation, iterative denoising
  5. DCGAN Project → Advanced techniques, experimental methodology

💡 Key Insights

Generative Modeling Challenges

  • Mode Collapse (GANs): Generator only learns subset of data distribution
  • Training Instability (GANs): Balancing generator and discriminator
  • Blurry Images (VAEs): KL divergence regularization trade-off
  • Slow Sampling (Diffusion): Requires many denoising steps

Techniques Learned

  • Reparameterization Trick: Making sampling differentiable
  • Label Smoothing: Improving GAN training stability
  • Skip Connections: Preserving spatial information
  • Time Conditioning: Incorporating temporal information

📖 References

Papers

  • UNet: Ronneberger et al. (2015) - "U-Net: Convolutional Networks for Biomedical Image Segmentation"
  • VAE: Kingma & Welling (2014) - "Auto-Encoding Variational Bayes"
  • GAN: Goodfellow et al. (2014) - "Generative Adversarial Networks"
  • DCGAN: Radford et al. (2016) - "Unsupervised Representation Learning with Deep Convolutional GANs"
  • DDPM: Ho et al. (2020) - "Denoising Diffusion Probabilistic Models"

Resources

🚀 Getting Started

Each assignment has its own README with specific setup and usage instructions. Start with:

  1. A1/README.md - UNet implementation
  2. A2/README.md - VAE training
  3. A3/README.md - GAN experiments
  4. A4/README.md - Diffusion models
  5. Project/README.md - Final project

📝 Notes

  • All code is implemented from scratch (no pre-trained models)
  • Experiments are reproducible with fixed random seeds
  • Visualizations and results are included in each assignment folder
  • Training times vary based on hardware (GPU recommended)

This repository demonstrates comprehensive understanding of modern generative modeling techniques, from foundational architectures to state-of-the-art methods.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages