-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinetuning-am-ru.sh
65 lines (53 loc) · 1.79 KB
/
finetuning-am-ru.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
. ./cmd.sh
data_set=train
data_dir=data/${data_set}
ali_dir=exp/${data_set}_ali
src_dir=exp/nnet3/tdnn_sp
dir=${src_dir}_${data_set}
num_jobs_initial=1
num_jobs_final=1
num_epochs=1
initial_effective_lrate=0.000005
final_effective_lrate=0.000001
minibatch_size=128
stage=1
train_stage=-10
nj=1
if [ $stage -le 1 ]; then
steps/make_mfcc.sh \
--cmd "$train_cmd" --nj $nj \
${data_dir} exp/make_mfcc/${data_set} mfcc
steps/compute_cmvn_stats.sh ${data_dir} exp/make_mfcc/${data_set} mfcc || exit 1;
utils/fix_data_dir.sh ${data_dir} || exit 1;
# extract ivector features
sh steps/online/nnet2/extract_ivectors_online.sh $data_dir ivector exp/nnet3_online/ivectors_test
# extract align features
sh steps/nnet3/align.sh $data_dir data/lang am $ali_dir
fi
echo -----
echo 2
echo -----
if [ $stage -le 2 ]; then
$train_cmd $dir/log/generate_input_model.log nnet3-am-copy --raw=true "$am/final.mdl" "$dir/input.raw";
fi
echo -----
echo 3
echo -----
if [ $stage -le 3 ]; then
steps/nnet3/train_dnn.py --stage=$train_stage \
--cmd="$decode_cmd" \
--feat.cmvn-opts="--norm-means=false --norm-vars=false" \
--trainer.input-model $dir/input.raw \
--trainer.num-epochs $num_epochs \
--trainer.optimization.num-jobs-initial $num_jobs_initial \
--trainer.optimization.num-jobs-final $num_jobs_final \
--trainer.optimization.initial-effective-lrate $initial_effective_lrate \
--trainer.optimization.final-effective-lrate $final_effective_lrate \
--trainer.optimization.minibatch-size $minibatch_size \
--feat-dir ${data_dir} \
--lang data/lang \
--ali-dir ${ali_dir} \
--feat.online-ivector-dir exp/nnet3_online/ivectors_test \
--egs.frames-per-eg 100 \
--dir $dir || exit 1;
fi