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.
# 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 Train model with default configuration
# train on CPU
python src/train.py trainer=cpu
# train on GPU
python src/train.py trainer=gpuTrain model with chosen experiment configuration from configs/experiment/
python src/train.py experiment=experiment_name.yamlYou can override any parameter from command line like this
python src/train.py trainer.max_epochs=20 data.batch_size=64You can test MoDL by running this experiment & modify any params in it
python src/train.py experiment=modl.yamlOr DDIM by running this experiment & modify net params in it
python src/train.py experiment=diffusion.yamlOr DDPM by running this experiment & modify net params in it
python src/train.py experiment=diffusion.yamlYou can see the result on wandb by run this script
export WANDB_API_KEY=
python src/train.py experiment=diffusion.yamlI 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.