forked from lab-emi/OpenDPD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain_all_dpd.sh
executable file
·68 lines (61 loc) · 2.22 KB
/
train_all_dpd.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Arguments
while getopts g: option
do
case "${option}"
in
g) gpu_device=${OPTARG};;
esac
done
# Global Settings
dataset_name=DPA_200MHz
accelerator=cuda
devices=0
# Hyperparameters
seed=0
n_epochs=100
frame_length=50
frame_stride=1
loss_type=l2
opt_type=adamw
batch_size=64
batch_size_eval=256
lr_schedule=1
lr=1e-3
lr_end=1e-6
decay_factor=0.5
patience=10
#########################
# Train
#########################
seed=(0 1 2 3 4)
# PA Model
PA_backbone=dgru
PA_hidden_size=8
PA_num_layers=1
# DPD Model
DPD_backbone=(dgru fcn gru lstm)
DPD_hidden_size=(8 20 11 9)
DPD_num_layers=(1 2 1 1)
for i_seed in "${seed[@]}"; do
for ((i=0; i<${#DPD_backbone[@]}; i++)); do
# Train DPD
step=train_dpd
python main.py --dataset_name "$dataset_name" --seed "$i_seed" --step "$step"\
--accelerator "$accelerator" --devices "$devices"\
--PA_backbone "$PA_backbone" --PA_hidden_size "$PA_hidden_size" --PA_num_layers "$PA_num_layers"\
--DPD_backbone "${DPD_backbone[$i]}" --DPD_hidden_size "${DPD_hidden_size[$i]}" --DPD_num_layers "${DPD_num_layers[$i]}"\
--frame_length "$frame_length" --frame_stride "$frame_stride" --loss_type "$loss_type" --opt_type "$opt_type"\
--batch_size "$batch_size" --batch_size_eval "$batch_size_eval" --n_epochs "$n_epochs" --lr_schedule "$lr_schedule"\
--lr "$lr" --lr_end "$lr_end" --decay_factor "$decay_factor" --patience "$patience" || exit 1;
# Run DPD
step=run_dpd
python main.py --dataset_name "$dataset_name" --seed "$i_seed" --step "$step"\
--accelerator "$accelerator" --devices "$devices"\
--PA_backbone "$PA_backbone" --PA_hidden_size "$PA_hidden_size" --PA_num_layers "$PA_num_layers"\
--DPD_backbone "${DPD_backbone[$i]}" --DPD_hidden_size "${DPD_hidden_size[$i]}" --DPD_num_layers "${DPD_num_layers[$i]}"\
--frame_length "$frame_length" --frame_stride "$frame_stride" --loss_type "$loss_type" --opt_type "$opt_type"\
--batch_size "$batch_size" --batch_size_eval "$batch_size_eval" --n_epochs "$n_epochs" --lr_schedule "$lr_schedule"\
--lr "$lr" --lr_end "$lr_end" --decay_factor "$decay_factor" --patience "$patience" || exit 1;
done
done