{"id":19382915,"url":"https://github.com/locuslab/deq-ddim","last_synced_at":"2026-02-27T22:11:18.704Z","repository":{"id":91902577,"uuid":"556385765","full_name":"locuslab/deq-ddim","owner":"locuslab","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-22T17:07:26.000Z","size":129,"stargazers_count":61,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T20:11:29.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/locuslab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-23T18:31:09.000Z","updated_at":"2024-10-07T12:21:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"39b56415-e6c7-4ef0-96d4-be3c3760e798","html_url":"https://github.com/locuslab/deq-ddim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Fdeq-ddim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Fdeq-ddim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Fdeq-ddim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Fdeq-ddim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/locuslab","download_url":"https://codeload.github.com/locuslab/deq-ddim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250509875,"owners_count":21442514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T09:23:50.429Z","updated_at":"2026-02-27T22:11:13.655Z","avatar_url":"https://github.com/locuslab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep Equilibrium Approaches to Diffusion Models \n\nAshwini Pokle, Zhengyang Geng and Zico Kolter, NeurIPS 2022 [[arxiv link](https://arxiv.org/abs/2210.12867)]\n\n\nThis codebase has been adapted largely from the repository of Denoising Diffusion Implicit Models (DDIM) by Song. et. al. 2020 (https://arxiv.org/abs/2010.02502) (Note: we include the original MIT license that belongs to the authors of prior work (Song. et. al.) in this codebase.)\n\n## Getting Started \n\nCreate conda environment and install all packages from `requirements.txt`\n```\nconda create --name \u003cenvironment_name\u003e --file requirements.txt\nconda activate \u003cenvironment_name\u003e\n```\n\nIf you are working with CelebA 64x64 dataset, please download pretrained checkpoint from https://github.com/ermongroup/ddim\nIf you are working with any of the other datasets like CIFAR10, LSUN Bedrooms or Outdoor Churches, please update the path to your cache directory [here](https://github.com/ashwinipokle/deq-ddim/blob/main/functions/ckpt_util.py#L60)\n\n## Running the Experiments\nThe code has been tested on PyTorch 1.11.\n\n### Sampling\n\n#### Sampling for FID evaluation\n\nGeneral command to sample with a DEQ or DDIM is:\n```\npython main.py --config {DATASET}.yml --model Diffusion --exp {PROJECT_PATH} --image_folder {IMG_FOLDER} --doc {DOCUMENTATIOIN_FOLDER} --sample --fid --timesteps 1000 --eta 0 --ni --method {METHOD} --use_pretrained\n```\nwhere \n- `ETA` controls the scale of the variance (0 is DDIM, and 1 is one type of DDPM).\n- `STEPS` controls how many timesteps used in the process.\n- `MODEL_NAME` finds the pre-trained checkpoint according to its inferred path.\n- `METHOD` Use 'anderson' for DEQ and 'simple-seq' for DDIM\n\nPlease check [generate_deq_convergence.sh](scripts/generate_deq_convergence.sh) for sampling commands for all the datasets.\n\nExample command for sampling with DEQ from CIFAR10\n```\npython main.py --config cifar10.yml --model Diffusion --exp cifar10-orig-fid --image_folder samples-cifar10-and-t1000-long-new --doc cifar10 --sample --fid --timesteps 1000 --eta 0 --ni --method anderson --use_pretrained\n```\nThe `--use_pretrained` option will automatically load the model according to the dataset for CIFAR10, LSUN Bedrooms and Churches. We use DDPM models for all datasets except CelebA. Please download CelebA 64x64 pretrained model from https://github.com/ermongroup/ddim\n\n### Training DEQ for Model Inversion\n```\n python main.py --config {DATASET}_ls_opt.yml --model DiffusionInversion --exp {PROJECT_PATH} --image_folder {IMAGE_FOLDER} --doc {MODEL_NAME} --ls_opt --timesteps {STEPS} --ni --method {METHOD} --lambda1 1 --lambda2 0 --lambda3 0 --seed $i --tau {DAMPING_FACTOR} --use_wandb --no_augmentation --pg_steps {PG_STEPS}\n```\nwhere\n- `ETA` controls the scale of the variance (0 is DDIM, and 1 is one type of DDPM).\n- `STEPS` controls how many timesteps used in the process.\n- `MODEL_NAME` finds the pre-trained checkpoint according to its inferred path.\n- `METHOD` Use 'anderson' for DEQ and 'simple-seq' for DDIM\n- `PG_STEPS` is the number of iterations while computing phantom gradients. We set this value to 1.\n- `DAMPING_FACTOR` is the value of damping used in phantom gradients. We set this to 0.1.\n\nPlease check [invert_models.sh](scripts/invert_models.sh) for sampling commands for all the datasets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Fdeq-ddim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocuslab%2Fdeq-ddim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Fdeq-ddim/lists"}