-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreadme.txt
28 lines (17 loc) · 1.24 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
###create environment and install packages
conda create -n env_name python=3.8 -y
conda activate env_name
pip install -r requirements.txt
###our core code of algorithm is in class DoPrompt_group_decompose in domainbed/algorithms.py, our training and testing code are in domainbed/scripts/train_epvt.py and
###domainbed/scripts/test_epvt.py
### train our EPVT ###
#training isic2019
CUDA_VISIBLE_DEVICES=0 python -m domainbed.scripts.train_epvt --data_dir=./domainbed/data/ --steps 1501 --dataset SKIN --test_env 0 --algorithm DoPrompt_group_decompose --output_dir \
results/exp --hparams '{"lr": 5e-6, "lr_classifier": 5e-5,"batch_size":26,"wd_classifier": 1e-5, "prompt_dim":10}' --exp 'prompt_final_vis' --ood_vis True
##test EPVT on four ood datasets
CUDA_VISIBLE_DEVICES=0 python -m domainbed.scripts.test_epvt --model_name 'prompt_final_vis.pkl'
#### train ERM baseline ###
CUDA_VISIBLE_DEVICES=1 python -m domainbed.scripts.train_erm --data_dir=./domainbed/data/ --steps 1501 --dataset SKIN --test_env 0 --algorithm ERM \
--output_dir results/exp --hparams '{"lr": 5e-6, "lr_classifier": 5e-5,"batch_size":26,"wd_classifier":1e-5}' --exp 'erm_baseline'
##test ERM on four ood datasets
CUDA_VISIBLE_DEVICES=1 python -m domainbed.scripts.test_erm --model_nam