-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscratch_grid_search.sh
51 lines (47 loc) · 1.55 KB
/
scratch_grid_search.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
47
48
49
50
51
#! /bin/bash
target=CaCO3
annotation_files=(
'info_10.csv'
'info_50.csv'
'info_100.csv'
'info_500.csv'
'info_1000.csv'
'info.csv'
)
epochs=(10 25 50 75 100)
warm_ups=(1 3 5 8 10)
lrs=(1e-4 1e-5 1e-6)
for annotation_file in ${annotation_files[*]};
do
for lr in ${lrs[*]};
do
for (( i=0; i<${#epochs[*]}; ++i));
do
epoch=${epochs[$i]}
warm_up=${warm_ups[$i]}
output_dir="results/scratch-$target-$annotation_file-epochs-$epoch-blr-$lr/"
echo "START $target train=$annotation_file, blr=$lr, epochs=$epoch, warm_up=$warm_up"
python finetune.py \
--annotation_file data/finetune/${target}%/train/$annotation_file \
--input_dir data/finetune/${target}%/train \
--val_annotation_file data/finetune/${target}%/train/val.csv \
--output_dir $output_dir \
--verbose \
--device cuda \
--from_scratch \
--batch_size 256 \
--epochs $epoch \
--warmup_epochs $warm_up \
--blr $lr \
--target_mean src/datas/xpt_${target}_target_mean.pth \
--target_std src/datas/xpt_${target}_target_std.pth
python eval_finetune.py \
--annotation_file data/finetune/${target}%/train/val.csv \
--input_dir data/finetune/${target}%/train/ \
--test-only \
--transform instance_normalize \
--target $target \
--weight "$output_dir/model.ckpt"
done
done
done