99
1010# GPU device id to use (count from 0).
1111# you can also set `CUDA_VISIBLE_DEVICES` and set `device_id=0`
12- device_id=0
12+ device_id=6
1313
1414nj=10
1515
@@ -19,8 +19,8 @@ lat_dir=exp/tri5a_lats # input lat dir
1919treedir=exp/chain/tri5_tree # output tree dir
2020
2121# You should know how to calculate your model's left/right context **manually**
22- model_left_context=12
23- model_right_context=12
22+ model_left_context=28
23+ model_right_context=28
2424egs_left_context=$[$model_left_context + 1]
2525egs_right_context=$[$model_right_context + 1]
2626frames_per_eg=150,110,90
@@ -30,9 +30,10 @@ minibatch_size=128
3030num_epochs=6
3131lr=1e-3
3232
33- hidden_dim=625
34- kernel_size_list=" 1, 3, 3, 3, 3, 3" # comma separated list
35- stride_list=" 1, 1, 3, 1, 1, 1" # comma separated list
33+ hidden_dim=1024
34+ bottleneck_dim=128
35+ time_stride_list=" 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1" # comma separated list
36+ conv_stride_list=" 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1" # comma separated list
3637
3738log_level=info # valid values: debug, info, warning
3839
@@ -47,11 +48,16 @@ save_nn_output_as_compressed=false
4748
4849if [[ $stage -le 0 ]]; then
4950 for datadir in train dev test ; do
50- dst_dir=data/fbank_pitch /$datadir
51+ dst_dir=data/mfcc_hires /$datadir
5152 if [[ ! -f $dst_dir /feats.scp ]]; then
53+ echo " making mfcc-pitch features for LF-MMI training"
5254 utils/copy_data_dir.sh data/$datadir $dst_dir
53- echo " making fbank-pitch features for LF-MMI training"
54- steps/make_fbank_pitch.sh --cmd $train_cmd --nj $nj $dst_dir || exit 1
55+ steps/make_mfcc_pitch.sh \
56+ --mfcc-config conf/mfcc_hires.conf \
57+ --pitch-config conf/pitch.conf \
58+ --cmd " $train_cmd " \
59+ --nj $nj \
60+ $dst_dir || exit 1
5561 steps/compute_cmvn_stats.sh $dst_dir || exit 1
5662 utils/fix_data_dir.sh $dst_dir
5763 else
@@ -80,12 +86,12 @@ if [[ $stage -le 2 ]]; then
8086 # step compared with other recipes.
8187 steps/nnet3/chain/build_tree.sh --frame-subsampling-factor 3 \
8288 --context-opts " --context-width=2 --central-position=1" \
83- --cmd " $train_cmd " 5000 data/train $lang $ali_dir $treedir
89+ --cmd " $train_cmd " 5000 data/mfcc/ train $lang $ali_dir $treedir
8490fi
8591
8692if [[ $stage -le 3 ]]; then
8793 echo " creating phone language-model"
88- $train_cmd exp/chain/log/make_phone_lm.log \
94+ " $train_cmd " exp/chain/log/make_phone_lm.log \
8995 chain-est-phone-lm \
9096 " ark:gunzip -c $treedir /ali.*.gz | ali-to-phones $treedir /final.mdl ark:- ark:- |" \
9197 exp/chain/phone_lm.fst || exit 1
@@ -95,7 +101,7 @@ if [[ $stage -le 4 ]]; then
95101 echo " creating denominator FST"
96102 copy-transition-model $treedir /final.mdl exp/chain/0.trans_mdl
97103 cp $treedir /tree exp/chain
98- $train_cmd exp/chain/log/make_den_fst.log \
104+ " $train_cmd " exp/chain/log/make_den_fst.log \
99105 chain-make-den-fst exp/chain/tree exp/chain/0.trans_mdl exp/chain/phone_lm.fst \
100106 exp/chain/den.fst exp/chain/normalization.fst || exit 1
101107fi
@@ -119,7 +125,7 @@ if [[ $stage -le 5 ]]; then
119125 --right-tolerance 5 \
120126 --srand 0 \
121127 --stage -10 \
122- data/fbank_pitch /train \
128+ data/mfcc_hires /train \
123129 exp/chain $lat_dir exp/chain/egs
124130fi
125131
@@ -157,16 +163,17 @@ if [[ $stage -le 8 ]]; then
157163
158164 # sort the options alphabetically
159165 python3 ./chain/train.py \
166+ --bottleneck-dim $bottleneck_dim \
160167 --checkpoint=${train_checkpoint:- } \
168+ --conv-stride-list " $conv_stride_list " \
161169 --device-id $device_id \
162170 --dir exp/chain/train \
163171 --feat-dim $feat_dim \
164172 --hidden-dim $hidden_dim \
165173 --is-training true \
166- --kernel-size-list " $kernel_size_list " \
167174 --log-level $log_level \
168175 --output-dim $output_dim \
169- --stride-list " $stride_list " \
176+ --time- stride-list " $time_stride_list " \
170177 --train.cegs-dir exp/chain/merged_egs \
171178 --train.den-fst exp/chain/den.fst \
172179 --train.egs-left-context $egs_left_context \
@@ -186,20 +193,21 @@ if [[ $stage -le 9 ]]; then
186193 best_epoch=$( cat exp/chain/train/best-epoch-info | grep ' best epoch' | awk ' {print $NF}' )
187194 inference_checkpoint=exp/chain/train/epoch-${best_epoch} .pt
188195 python3 ./chain/inference.py \
196+ --bottleneck-dim $bottleneck_dim \
189197 --checkpoint $inference_checkpoint \
198+ --conv-stride-list " $conv_stride_list "
190199 --device-id $device_id \
191200 --dir exp/chain/inference/$x \
192201 --feat-dim $feat_dim \
193- --feats-scp data/fbank_pitch /$x /feats.scp \
202+ --feats-scp data/mfcc_hires /$x /feats.scp \
194203 --hidden-dim $hidden_dim \
195204 --is-training false \
196- --kernel-size-list " $kernel_size_list " \
197205 --log-level $log_level \
198206 --model-left-context $model_left_context \
199207 --model-right-context $model_right_context \
200208 --output-dim $output_dim \
201209 --save-as-compressed $save_nn_output_as_compressed \
202- --stride-list " $stride_list " || exit 1
210+ --time- stride-list " $time_stride_list " || exit 1
203211 fi
204212 done
205213fi
@@ -228,7 +236,7 @@ if [[ $stage -le 11 ]]; then
228236
229237 for x in test dev; do
230238 ./local/score.sh --cmd " $decode_cmd " \
231- data/fbank_pitch /$x \
239+ data/mfcc_hires /$x \
232240 exp/chain/graph \
233241 exp/chain/decode_res/$x || exit 1
234242 done
0 commit comments