Flow matching implementation for conditional image generation based on the CIFAR-10 dataset.
This project was completed as the final project for DSCI 6602 at Memorial University of Newfoundland.
This project implements flow matching for class-conditional image generation on CIFAR-10.
Key features:
- UNet backbone adapted from DDPM
- Classifier-free guidance
- Exponential Moving Average (EMA)
The UNet implementation adapted from the DDPM Hugging Face implementation was used:
Where ResNet and Self attention subblocks are defined as:
Use Conda to set up the environment.
conda create -n flow_matching python=3.10
conda activate flow_matching
cd FlowMatching
. setup.sh
First, specify the appropriate settings in:
configs/config.json
Logging is performed using Weights & Biases (wandb). You may need to log in prior to training.
wandb login
conda activate flow_matching
cd FlowMatching
# To start training
python scripts/train.py
# To run inference
python scripts/inference.py
Examples of class-conditional CIFAR-10 generated images after