-
Notifications
You must be signed in to change notification settings - Fork 18
/
do_subject.sh
executable file
·32 lines (25 loc) · 771 Bytes
/
do_subject.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
#!/bin/bash
function echoHeader() {
local message=$1
printf "\033[0;34m"
echo "================================================================================"
echo "= $message"
echo "================================================================================"
printf "\033[0m"
}
if [[ ! $1 ]]; then
echo "No subject specified!"
exit 1
fi
# Run setup
echoHeader "Running setup..."
sh setup.sh $1
clear old files
rm -f data/torch/*.t7
rm -f cv/*.t7
echoHeader "Training LSTM..."
th train_lstm.lua -seq_length 800 -batch_size 5 -print_every 10 -eval_val_every 100 -max_epochs 20 -rnn_size 100 -dropout 0.5
# Find the best model
best_checkpoint=$(ls -1 cv | sort | head -1)
echoHeader "Sampling validation set"
th sample.lua cv/$best_checkpoint