{"id":23530313,"url":"https://github.com/vinesmsuic/simple-ddpm-annotated","last_synced_at":"2026-03-06T12:33:59.150Z","repository":{"id":64085207,"uuid":"567632076","full_name":"vinesmsuic/simple-DDPM-annotated","owner":"vinesmsuic","description":" A simplified DDPM implementation with annotated explanation, for educational purpose","archived":false,"fork":false,"pushed_at":"2022-12-04T06:22:17.000Z","size":20,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T18:56:48.020Z","etag":null,"topics":["ddpm","diffusion","diffusion-models","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vinesmsuic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-18T08:03:39.000Z","updated_at":"2023-01-30T19:21:06.000Z","dependencies_parsed_at":"2023-01-14T21:31:00.885Z","dependency_job_id":null,"html_url":"https://github.com/vinesmsuic/simple-DDPM-annotated","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vinesmsuic/simple-DDPM-annotated","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinesmsuic%2Fsimple-DDPM-annotated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinesmsuic%2Fsimple-DDPM-annotated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinesmsuic%2Fsimple-DDPM-annotated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinesmsuic%2Fsimple-DDPM-annotated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinesmsuic","download_url":"https://codeload.github.com/vinesmsuic/simple-DDPM-annotated/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinesmsuic%2Fsimple-DDPM-annotated/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30176306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T11:48:51.886Z","status":"ssl_error","status_checked_at":"2026-03-06T11:48:51.460Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ddpm","diffusion","diffusion-models","pytorch"],"created_at":"2024-12-25T21:16:36.254Z","updated_at":"2026-03-06T12:33:59.120Z","avatar_url":"https://github.com/vinesmsuic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple DDPM\n\nA simplified DDPM implementation for educational purpose.\n\n## Example\n\nenvironment.yaml is provided for conda users to setup the conda environment.\n```shell\nconda env create -f environment.yaml\nconda activate ddpm_simple\n```\n\nThe example dataset can be downloaded using gdown:\n```shell\ngdown https://drive.google.com/uc?id=1qp9hxwksxpinKKTiHFtMIrQDeWcqnuXm\nunzip catsfaces_64x64.zip\n```\n\nResult after training for 495 epochs using MSE loss:\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"300\" height=\"300\" src=\"https://user-images.githubusercontent.com/77888770/205251258-acb6659b-7e92-48a4-9b6f-2ff902353b3d.png\"\u003e\n\u003c/p\u003e\n\n## Repo Structure\n\n```shell\n.\n├── ddpm.py # a DDPM class containing methods for forward diffusion (with visualization); and reverse diffusion using the UNet.\n├── inference.py # a inference script with argument parser for trained models.\n├── my_dataset.py # an example of making ur own dataset in pytorch.\n├── scheduler.py # a beta scheduler with visualization\n├── train.py # a training script with argument parser.\n├── UNet.py # a minimal example of UNet with time embedding.\n└── utils.py # seeding function and misc. stuffs.\n```\n\n\n### Train\n\n```shell\nusage: train.py [-h] -s SOURCE [-b BATCH_SIZE]\n                [-ims IMSIZE] [-T TIMESTEPS]\n                [-ep EPOCH] [-sd SEED] [-d DEST]        \n                [-l LOSS]\n\noptional arguments:\n  -h, --help            show this help message and      \n                        exit\n  -s SOURCE, --source SOURCE\n                        filepath to your dataset image  \n                        folder.\n  -b BATCH_SIZE, --batch_size BATCH_SIZE\n                        batch size.\n  -ims IMSIZE, --imsize IMSIZE\n                        image size.\n  -T TIMESTEPS, --timesteps TIMESTEPS\n                        timesteps.\n  -ep EPOCH, --epoch EPOCH\n                        epochs. 500 is enough to make   \n                        a clear images\n  -sd SEED, --seed SEED\n                        seed number. Default is 42 for\n                        reproducible result\n  -d DEST, --dest DEST  Destination folder path for\n                        saving results.\n  -l LOSS, --loss LOSS  Use of loss function, either\n                        'l1' or 'MSE'\n```\n\n\n### Inference\n```shell\nusage: inference.py [-h] -w WEIGHT [-n NUM_SAMPLES] [-ims IMSIZE] [-T TIMESTEPS] [-sd SEED] [-d DEST]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -w WEIGHT, --weight WEIGHT\n                        filepath to your weight file.\n  -n NUM_SAMPLES, --num_samples NUM_SAMPLES\n                        num_samples.\n  -ims IMSIZE, --imsize IMSIZE\n                        image size.\n  -T TIMESTEPS, --timesteps TIMESTEPS\n                        timesteps.\n  -sd SEED, --seed SEED\n                        seed number. Default is 42 for reproducible result\n  -d DEST, --dest DEST  Destination folder path for saving results.\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinesmsuic%2Fsimple-ddpm-annotated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinesmsuic%2Fsimple-ddpm-annotated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinesmsuic%2Fsimple-ddpm-annotated/lists"}