forked from landskape-ai/Reprogram_LT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
46 lines (38 loc) · 1.51 KB
/
run.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
export CUDA_VISIBLE_DEVICES=0
model=$1 # check `--model` choices in `experiments/cnn/ilm_vp.py` script
dataset=$2 # check `--dataset` choices in `experiments/cnn/ilm_vp.py` script
n_shots=(-1 1 10 50 100)
seeds=(1 2 3)
declare -A batch_sizes
batch_sizes=( [-1]=256 [1]=8 [10]=32 [50]=64 [100]=128 )
for n_shot in "${n_shots[@]}"; do
for seed in "${seeds[@]}"; do
batch_size=${batch_sizes[$n_shot]}
if [ -z "$batch_size" ]; then
echo "Unsupported n_shot value: $n_shot"
exit 1
fi
# ---------------------------------------------------------------------------
# ILM-VP experiment
# ---------------------------------------------------------------------------
python3 experiments/cnn/ilm_vp.py \
--model $model \
--n_shot $n_shot \
--seed $seed \
--batch_size $batch_size \
--dataset $dataset \
--results_path results \
--wandb
# ---------------------------------------------------------------------------
# LP experiment
# ---------------------------------------------------------------------------
python3 experiments/cnn/linear_probing.py \
--model $model \
--n_shot $n_shot \
--seed $seed \
--batch_size $batch_size \
--dataset $dataset \
--results_path results \
--wandb
done
done