-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtime_shards.sh
37 lines (30 loc) · 876 Bytes
/
time_shards.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
DATA_DIR='/path/to/data'
SAVED_MODELS_DIR='path/to/saved_models'
LOG_DIR='path/to/training_logs'
for size in 256 512 1024 2048 4096;
do
# train on first 5 shards
for i in $(seq 0 4)
do
# initialize weights for first shard
if (( $i == 0 ))
then
(time python multi-gpu-train.py --data_dir=$DATA_DIR/ \
--shard=${i} \
--saved_models_dir=$SAVED_MODELS_DIR/$size/ \
--log_dir=$LOG_DIR/$size/ \
--rnn_size=$size \
--timer=$size-time) 2>>$size-time
else
# initialise from previous checkpoint
let a=$i-1
(time python multi-gpu-train.py --data_dir=$DATA_DIR/ \
--shard=${i} \
--saved_models_dir=$SAVED_MODELS_DIR/$size/ \
--log_dir=$LOG_DIR/$size/ \
--restore_path=$SAVED_MODELS_DIR/$size/$a \
--rnn_size=$size \
--timer=$size-time) 2>>$size-time
fi
done
done