{"id":26432891,"url":"https://github.com/zhengzangw/doprompt","last_synced_at":"2025-03-18T06:28:30.029Z","repository":{"id":65555896,"uuid":"484768272","full_name":"zhengzangw/DoPrompt","owner":"zhengzangw","description":"Official implementation of PCS in essay \"Prompt Vision Transformer for Domain Generalization\"","archived":false,"fork":false,"pushed_at":"2023-01-29T12:32:58.000Z","size":1461,"stargazers_count":46,"open_issues_count":5,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-23T00:12:59.164Z","etag":null,"topics":["deep-learning","domain-adaptation","domain-generalization","prompt-tuning","vision-transformer"],"latest_commit_sha":null,"homepage":"","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/zhengzangw.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}},"created_at":"2022-04-23T14:22:28.000Z","updated_at":"2024-04-09T08:07:04.000Z","dependencies_parsed_at":"2023-02-15T21:31:03.715Z","dependency_job_id":null,"html_url":"https://github.com/zhengzangw/DoPrompt","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/zhengzangw%2FDoPrompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengzangw%2FDoPrompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengzangw%2FDoPrompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengzangw%2FDoPrompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhengzangw","download_url":"https://codeload.github.com/zhengzangw/DoPrompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244168632,"owners_count":20409565,"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":["deep-learning","domain-adaptation","domain-generalization","prompt-tuning","vision-transformer"],"created_at":"2025-03-18T06:28:29.494Z","updated_at":"2025-03-18T06:28:30.019Z","avatar_url":"https://github.com/zhengzangw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prompt Vision Transformer for Domain Generalization (DoPrompt)\n\nPytorch implementation of **DoPrompt** ([Prompt Vision Transformer for Domain Generalization](https://arxiv.org/abs/2208.08914))\n\n## Overview\n\nArchitecture of Network:\n\n![framework](images/framework.png)\n\n## Training\n\nRefer to [DomainBed Readme](README_domainbed.md) for more details on commands running jobs. The training setting sweeps across multiple hyperparameters. Here we select some hyperparameters that can reach a good result. (Update 17/11/22: as many queries about the ERM baseline hyper-parameter, we present them below.)\n\n```sh\n# OfficeHome ERM\npython -m domainbed.scripts.train --data_dir=./domainbed/data/ --steps 5001 --dataset OfficeHome --test_env 0/1/2/3 --algorithm ERM --output_dir results/exp \\\n     --hparams '{\"lr\": 1e-5, \"lr_classifier\": 1e-4}'\n# OfficeHome\npython -m domainbed.scripts.train --data_dir=./domainbed/data/ --steps 5001 --dataset OfficeHome --test_env 0/1/2/3 --algorithm DoPrompt --output_dir results/exp \\\n     --hparams '{\"lr\": 1e-5, \"lr_classifier\": 1e-3}'\n# PACS ERM\npython -m domainbed.scripts.train --data_dir=./domainbed/data/ --steps 5001 --dataset PACS --test_env 0/2/3 --algorithm ERM --output_dir results/exp \\\n     --hparams '{\"lr\": 5e-6, \"lr_classifier\": 5e-5}'\n# PACS\npython -m domainbed.scripts.train --data_dir=./domainbed/data/ --steps 5001 --dataset PACS --test_env 0/2/3 --algorithm DoPrompt --output_dir results/exp \\\n     --hparams '{\"lr\": 5e-6, \"lr_classifier\": 5e-5, \"wd_classifier\": 1e-5}'\n# VLCS ERM\npython -m domainbed.scripts.train --data_dir=./domainbed/data/ --steps 5001 --dataset VLCS --test_env 0/1/2/3 --algorithm ERM --output_dir results/exp \\\n     --hparams '{\"lr\": 5e-6, \"lr_classifier\": 5e-5}'\n# VLCS\npython -m domainbed.scripts.train --data_dir=./domainbed/data/ --steps 5001 --dataset VLCS --test_env 0/1/2/3 --algorithm DoPrompt --output_dir results/exp \\\n     --hparams '{\"lr\": 5e-6, \"lr_classifier\": 5e-6}'\n```\n\n## Collect Results\n\n```sh\npython -m domainbed.scripts.collect_results --input_dir=results\n```\n\n## Requirements\n\n```sh\npip install -r domainbed/requirements.txt\n```\n\n## Citation\n\n```bibtex\n@article{zheng2022prompt,\n  title={Prompt Vision Transformer for Domain Generalization},\n  author={Zheng, Zangwei and Yue, Xiangyu and Wang, Kai and You, Yang},\n  journal={arXiv preprint arXiv:2208.08914},\n  year={2022}\n}\n```\n\n## Acknowlegdement\n\nThis code is built on [DomainBed](https://github.com/facebookresearch/DomainBed). We thank the authors for sharing their codes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhengzangw%2Fdoprompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhengzangw%2Fdoprompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhengzangw%2Fdoprompt/lists"}