{"id":19382866,"url":"https://github.com/locuslab/get","last_synced_at":"2025-04-13T23:55:20.421Z","repository":{"id":206622601,"uuid":"667142994","full_name":"locuslab/get","owner":"locuslab","description":"Generative Equilibrium Transformer","archived":false,"fork":false,"pushed_at":"2023-11-11T04:37:47.000Z","size":143,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-27T14:05:43.747Z","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}},"created_at":"2023-07-16T19:24:50.000Z","updated_at":"2024-12-12T07:53:31.000Z","dependencies_parsed_at":"2023-11-11T06:37:18.065Z","dependency_job_id":null,"html_url":"https://github.com/locuslab/get","commit_stats":null,"previous_names":["locuslab/get"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Fget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Fget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Fget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Fget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/locuslab","download_url":"https://codeload.github.com/locuslab/get/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799914,"owners_count":21163403,"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:38.588Z","updated_at":"2025-04-13T23:55:20.391Z","avatar_url":"https://github.com/locuslab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generative Equilibrium Transformer\n\nThis is the official repo for the paper [*One-Step Diffusion Distillation via Deep Equilibrium Models*](), \nby [Zhengyang Geng](https://gsunshine.github.io/)\\*, [Ashwini Pokle](https://ashwinipokle.github.io/)\\*, and [J. Zico Kolter](http://zicokolter.com/).\n\n\u003cdiv align=center\u003e\u003cimg src=\"assets/GET.png\" width=\"728.5\" height=\"400\" /\u003e\u003c/div\u003e\n\n## Environment\n\n## Dataset\n\nFirst, download the datasets **EDM-Uncond-CIFAR** and **EDM-Cond-CIFAR** from [this link](https://drive.google.com/drive/folders/1dlFiS5ahwu7xne6fUNVNELaG12-AKn4I?usp=sharing).\nSet up the `--data_path` in `run.sh` to the dir where you store the datasets, like `--data_path DATA_DIR/EDM-Uncond-CIFAR-1M`.\n\nIn addition, download the precomputed dataset statistics from [this link](https://drive.google.com/drive/folders/1UBdzl6GtNMwNQ5U-4ESlIer43tNjiGJC).\nSet up the `--stat_path` in `run.sh` and `eval.sh` using your download dir plus stat name.\n\n## Training\n\nTo train a GET, run this command:\n\n```bash\nbash run.sh N_GPU DDP_PORT --model MODEL_NAME --name EXP_NAME\n```\n\n`N_GPU` is the number of GPU used for training.\n`DDP_PORT` is the port number for syncing gradient during distributed training.\n`MODEL_NAME` is the model's name.\nSee all available models using `python train.py -h`.\nThe training log, checkpoints, and sampled images will be saved to `./results` using your `EXP_NAME`.\n\nFor example, this command train a GET-S/2 (of patch size 2) on 4 GPUs.\n\n```bash\nbash run.sh 4 12345 --model GET-S/2 --name test-GET\n```\n\nTo train a ViT, run this command:\n\n```bash\nbash run.sh N_GPU DDP_PORT --model ViT-B/2 --name EXP_NAME\n```\n\nFor training **conditional** models, add the `--cond` command.\n\nFor the **O(1)-memory** training, add the `--mem` command.\n\n## Evaluation\n\nDownload pretrained models from [this link](https://drive.google.com/drive/u/1/folders/1g998S6moSQhybD9poDJHmXP85QF3zz4g).\n\nTo load a checkpoint for evaluation, run this command\n\n```bash\nbash run.sh N_GPU DDP_PORT --model MODEL_NAME --resume CKPT_PATH --name EXP_NAME\n```\n\nThe evaluation log and sampled images will be saved to `./eval-results` plus your `EXP_NAME`.\n\nFor evaluating conditional models, add the `--cond` command. Here is an example.\n\n```bash\nbash run.sh 4 12345 --model GET-B/2 --cond --resume CKPT_DIR/GET-B-cond-2M-data-bs256.pth\n```\n\n## Generative Performance\n\nYou can see [the generative performance here](STAT.md). The discussion there might be interesting.\n\n## Data Generation\n\nFirst, clone the EDM repo. Then, copy the files under `/data` to the `/edm` directory.\n\nSet up the `DATA_PATH` in `dataset.sh` for storing the synthetic dataset. \nRun the following command to generate both conditional and unconditional training sets.\n\n```bash\nbash dataset.sh\n```\n\nIf you want to generate more data pairs, adjust the range of `--seeds=0-MAX_SAMPLES`.\n\n## Bibtex\n\nIf you find our work helpful to your research, please consider citing this paper. :)\n\n```bib\n@inproceedings{\n    geng2023onestep,\n    title={One-Step Diffusion Distillation via Deep Equilibrium Models},\n    author={Zhengyang Geng and Ashwini Pokle and J Zico Kolter},\n    booktitle={Thirty-seventh Conference on Neural Information Processing Systems},\n    year={2023}\n}\n```\n\n## Contact\n\nFeel free to contact us if you have additional questions! \nPlease drop an email to zhengyanggeng@gmail.com (or [Twitter](https://twitter.com/ZhengyangGeng))\nor apokle@andrew.cmu.edu.\n\n## Acknowledgment\n\nThis project is built upon [TorchDEQ](https://github.com/locuslab/torchdeq), \n[DiT](https://arxiv.org/abs/2212.09748), \nand [timm](https://github.com/huggingface/pytorch-image-models).\nThanks for the awesome projects!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Fget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocuslab%2Fget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Fget/lists"}