Skip to content

ostapkhm/FlowMatchingCIFAR10

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlowMatchingCIFAR10

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.

Architecture

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:

Architecture

Where ResNet and Self attention subblocks are defined as:

ResNet and SA

Setup

Use Conda to set up the environment.

conda create -n flow_matching python=3.10
conda activate flow_matching

cd FlowMatching
. setup.sh

Training and inference

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

Some results

Examples of class-conditional CIFAR-10 generated images after $250$ epochs of training:

Ship class

Image

Car class

Image

References

About

Flow matching implementation for the CIFAR10 dataset.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published