forked from ml-jku/mc-lstm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mclstm_table1.sh
executable file
·75 lines (69 loc) · 2.77 KB
/
mclstm_table1.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
69
70
71
72
73
74
75
#/usr/bin/env sh
NUM_RUNS=100
EXP_NAME=lstm_addition
mkdir "${EXP_NAME}_configs";
export PYTHONPATH=".";
# generate configs
python utils/create_config_files.py \
--base_config experiments/addition/config.yml.example \
--seeds 1 $NUM_RUNS \
--change model "mclstm" \
--change lr 5e-2 && \
rename config_ config1_ utils/generated_configs/*.yml && \
mv utils/generated_configs/*.yml "${EXP_NAME}_configs" && \
rm -d utils/generated_configs;
python utils/create_config_files.py \
--base_config experiments/addition/config.yml.example \
--seeds 1 $NUM_RUNS \
--change model "lstm" \
--change lr 1e-3 && \
rename config_ config2_ utils/generated_configs/*.yml && \
mv utils/generated_configs/*.yml "${EXP_NAME}_configs" && \
rm -d utils/generated_configs;
python utils/create_config_files.py \
--base_config experiments/addition/config.yml.example \
--seeds 1 $NUM_RUNS \
--change model "nalu" \
--change lr 1e-3 && \
rename config_ config3_ utils/generated_configs/*.yml && \
mv utils/generated_configs/*.yml "${EXP_NAME}_configs" && \
rm -d utils/generated_configs;
python utils/create_config_files.py \
--base_config experiments/addition/config.yml.example \
--seeds 1 $NUM_RUNS \
--change model "nau" \
--change lr 1e-2 && \
rename config_ config4_ utils/generated_configs/*.yml && \
mv utils/generated_configs/*.yml "${EXP_NAME}_configs" && \
rm -d utils/generated_configs;
# additional baselines
python utils/create_config_files.py \
--base_config experiments/addition/config.yml.example \
--seeds 1 $NUM_RUNS \
--change model "lnlstm" \
--change lr 1e-3 && \
rename config_ config5_ utils/generated_configs/*.yml && \
mv utils/generated_configs/*.yml "${EXP_NAME}_configs" && \
rm -d utils/generated_configs;
python utils/create_config_files.py \
--base_config experiments/addition/config.yml.example \
--seeds 1 $NUM_RUNS \
--change model "urnn" \
--change lr 1e-3 && \
rename config_ config6_ utils/generated_configs/*.yml && \
mv utils/generated_configs/*.yml "${EXP_NAME}_configs" && \
rm -d utils/generated_configs;
# train all models
export PYTHONPATH=".";
ls "${EXP_NAME}_configs"/*.yml | xargs -n1 -P10 -i -- \
python experiments/addition/train.py --config {}
mkdir "${EXP_NAME}_runs";
mv runs/* "${EXP_NAME}_runs";
# evaluate models
python experiments/addition/test.py --run_dir "${EXP_NAME}_runs" --experiment "mclstm*";
python experiments/addition/test.py --run_dir "${EXP_NAME}_runs" --experiment "lstm*";
python experiments/addition/test.py --run_dir "${EXP_NAME}_runs" --experiment "nalu*";
python experiments/addition/test.py --run_dir "${EXP_NAME}_runs" --experiment "nau*";
python experiments/addition/test.py --run_dir "${EXP_NAME}_runs" --experiment "lnlstm*";
python experiments/addition/test.py --run_dir "${EXP_NAME}_runs" --experiment "urnn*";
unset PYTHONPATH;