-
Notifications
You must be signed in to change notification settings - Fork 1
/
generic_run.sh
executable file
·57 lines (42 loc) · 1.39 KB
/
generic_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
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# honestly this is no different from the python file at this point. only really keeping it around for loops i think?
## example run: lang=hist2_26_bos_with_attns heads=2 layers=2 ./generic_run.sh
[ -z "$lr" ] && lr=0.0003
[ -z "$gamma" ] && gamma=0.98
[ -z "$position" ] && position=sin # either sin or embed.
[ -z "$attn_c" ] && attn_c=100
[ -z "$dropout" ] && dropout=0.0
[ -z "$reset_patience" ] && reset_patience=10
[ -z "$small" ] && small=false
[ -z "$overfit" ] && overfit=false
[ -z "$tinyset" ] && tinyset=0
[ -z "$traincrop" ] && traincrop=0
[ -z "$heads" ] && heads=1
[ -z "$dim" ] && dim=128
[ -z "$layers" ] && layers=1
[ -z "$epochs" ] && epochs=50
[ -z "$batch_size" ] && batch_size=50
[ -z "$subfolder" ] && subfolder=""
ff=$((2*$dim))
if [ $small == true ]; then
heads=4
dim=16
ff=20
layers=2
tinyset=100
echo making small model
fi
optim="adam"
if [ $overfit == false ]; then
tinyflag="--tiny=$tinyset"
else
tinyflag="--overfit"
fi
echo training with $LAYERS layers
echo running with tinyflag: $tinyset
python3 MakeTransformer.py --lang=$lang --nheads=$heads --d-model=$dim \
--nlayers=$layers --ff=$ff \
--initial-lr=$lr --reset-patience=$reset_patience --n-epochs=$epochs --batch-size=$batch_size \
--subfolder=$subfolder --optim=$optim --gamma=$gamma \
--positional-encoding-type=$position $tinyflag --crop-train=$traincrop \
--attn-loss-c=$attn_c --dropout=$dropout