Skip to content

Page0526/diffusion_model

Repository files navigation

Diffusion

PyTorch Lightning Config: Hydra Template
Paper Conference

💡Description

At first, the repo is mainly about my process of implementing basic diffusion models from scratch when I'm studying diffusion models. Then, I started researching about image restoration problem and want to apply diffusion model, more specificially, on medical image, so this repo is more like a place where I record my researching journey. I may have made some (more like a lot :>) mistakes, I will certainly happy if you let me know about it.

🔍Installation

Pip

# clone project
git clone https://github.com/YourGithubName/your-repo-name
cd diffusion_model

# [OPTIONAL] create conda environment
conda create -n myenv python=3.9
conda activate myenv

# install pytorch according to instructions
# https://pytorch.org/get-started/

# install requirements using pip 
pip install -r requirements.txt
# or you can install requirements using conda
conda 

🔧How to run

Train model with default configuration

# train on CPU
python src/train.py trainer=cpu

# train on GPU
python src/train.py trainer=gpu

Train model with chosen experiment configuration from configs/experiment/

python src/train.py experiment=experiment_name.yaml

You can override any parameter from command line like this

python src/train.py trainer.max_epochs=20 data.batch_size=64

You can test MoDL by running this experiment & modify any params in it

python src/train.py experiment=modl.yaml

Or DDIM by running this experiment & modify net params in it

python src/train.py experiment=diffusion.yaml

Or DDPM by running this experiment & modify net params in it

python src/train.py experiment=diffusion.yaml

You can see the result on wandb by run this script

export WANDB_API_KEY=
python src/train.py experiment=diffusion.yaml

🌼My result

I will update sooner or later :> (this is my happy face incase you don't know)
A little confession as usual. Recently, I have applied to lots of AI jobs, but I got rejected from all of them, which is sad. However, I believe that when one door shuts, another one opens. I want to try my best and learn a lot, so I won’t have any regrets one day.

About

Where I learn to implement kinds of diffusion model from scratch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •