Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused feature types in nnet3 scripts #1711

Merged
merged 13 commits into from
Jun 29, 2017
Prev Previous commit
Next Next commit
fix --adjust-priors, --modify-learning-rates, --iter format and ivect…
…or info
  • Loading branch information
Hang Lyu committed Jun 27, 2017
commit 522bd50b47538e077493d4d1891c7ca6c04fa38e
1 change: 0 additions & 1 deletion egs/librispeech/s5/local/chain/run_tdnn_discriminative.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ if [ $stage -le 4 ]; then
--num-epochs $num_epochs --one-silence-class $one_silence_class --minibatch-size $minibatch_size \
--num-jobs-nnet $num_jobs_nnet --num-threads $num_threads \
--regularization-opts "$regularization_opts" --use-frame-shift false \
--adjust-priors false \
${degs_dir} $dir ;
fi

Expand Down
1 change: 1 addition & 0 deletions egs/mini_librispeech/s5/conf/decode.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# empty config, just use the defaults.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if [ $frame_subsampling_factor -ne 1 ]; then

data_dirs=
for x in `seq -$[frame_subsampling_factor/2] $[frame_subsampling_factor/2]`; do
steps/shift_feats.sh --cmd "$train_cmd --max-jobs-run 40" --nj 350 \
steps/shift_feats.sh --cmd "$train_cmd --max-jobs-run 40" --nj 30 \
$x $train_data_dir exp/shift_hires/ mfcc_hires
utils/fix_data_dir.sh ${train_data_dir}_fs$x
data_dirs="$data_dirs ${train_data_dir}_fs$x"
Expand Down Expand Up @@ -170,22 +170,22 @@ fi
if [ $stage -le 4 ]; then
steps/nnet3/train_discriminative.sh --cmd "$decode_cmd" \
--stage $train_stage \
--effective-lrate $effective_learning_rate --max-param-change $max_param_change \
--effectiv-elrate $effective_learning_rate --max-param-change $max_param_change \
--criterion $criterion --drop-frames true --acoustic-scale 1.0 \
--num-epochs $num_epochs --one-silence-class $one_silence_class --minibatch-size $minibatch_size \
--num-jobs-nnet $num_jobs_nnet --num-threads $num_threads \
--regularization-opts "$regularization_opts" --use-frame-shift false \
--adjust-priors false \
${degs_dir} $dir ;
${degs_dir} $dir ;
fi

# decode the adjusted model
if [ $stage -le 5 ]; then
rm $dir/.error 2>/dev/null || true

for x in `seq $decode_start_epoch $num_epochs`; do
for data in dev_clean_2; do
(
iter=epoch$x.adj
iter=epoch${x}_adj
nspk=$(wc -l <data/${data}_hires/spk2utt)

steps/nnet3/decode.sh \
Expand All @@ -209,13 +209,42 @@ if [ $stage -le 5 ]; then
[ -f $dir/.error ] && echo "$0: there was a problem while decoding" && exit 1
fi

# decode the normal model
if [ $stage -le 6 ]; then
rm $dir/.error 2>/dev/null || true

for x in `seq $decode_start_epoch $num_epochs`; do
for data in dev_clean_2; do
(
iter=epoch${x}
nspk=$(wc -l <data/${data}_hires/spk2utt)

steps/nnet3/decode.sh \
--iter $iter \
--acwt 1.0 --post-decode-acwt 10.0 \
--extra-left-context 0 \
--extra-right-context 0 \
--extra-left-context-initial 0 \
--extra-right-context-final 0 \
--frames-per-chunk 140 \
--nj $nspk --cmd "$decode_cmd" --num-threads 4 \
--online-ivector-dir exp/nnet3/ivectors_${data}_hires \
$tree_dir/graph_tgsmall data/${data}_hires ${dir}/decode_tgsmall_${data}_${iter} || exit 1
steps/lmrescore_const_arpa.sh --cmd "$decode_cmd" \
data/lang_test_{tgsmall,tglarge} \
data/${data}_hires ${dir}/decode_{tgsmall,tglarge}_${data}_${iter} || exit 1
) || touch $dir/.error &
done
done
wait
[ -f $dir/.error ] && echo "$0: there was a problem while decoding" && exit 1
fi

if [ $stage -le 6 ] && $cleanup; then
if [ $stage -le 7 ] && $cleanup; then
# if you run with "--cleanup true --stage 6" you can clean up.
rm ${lats_dir}/lat.*.gz || true
rm ${srcdir}_ali/ali.*.gz || true
steps/nnet2/remove_egs.sh ${srcdir}_degs || true
fi


exit 0;
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ if [ $stage -le 4 ]; then
--num-epochs $num_epochs --one-silence-class $one_silence_class --minibatch-size $minibatch_size \
--num-jobs-nnet $num_jobs_nnet --num-threads $num_threads \
--regularization-opts "$regularization_opts" --use-frame-shift false \
--adjust-priors false \
--modify-learning-rates false \
${degs_dir} $dir ;
fi

Expand All @@ -202,7 +200,7 @@ if [ $stage -le 5 ]; then
for decode_set in train_dev eval2000 rt03; do
(
num_jobs=`cat data/${decode_set}_hires/utt2spk|cut -d' ' -f2|sort -u|wc -l`
iter=epoch$x.adj
iter=epoch$x_adj

steps/nnet3/decode.sh --nj $num_jobs --cmd "$decode_cmd" --iter $iter \
--acwt 1.0 --post-decode-acwt 10.0 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ if [ $stage -le 4 ]; then
--num-epochs $num_epochs --one-silence-class $one_silence_class --minibatch-size $minibatch_size \
--num-jobs-nnet $num_jobs_nnet --num-threads $num_threads \
--regularization-opts "$regularization_opts" --use-frame-shift false \
--adjust-priors false \
--modify-learning-rates false \
${degs_dir} $dir ;
fi

Expand All @@ -229,7 +227,7 @@ if [ $stage -le 5 ]; then
for decode_set in train_dev eval2000 rt03; do
(
num_jobs=`cat data/${decode_set}_hires/utt2spk|cut -d' ' -f2|sort -u|wc -l`
iter=epoch$x.adj
iter=epoch$x_adj

steps/nnet3/decode.sh --nj $num_jobs --cmd "$decode_cmd" --iter $iter \
--acwt 1.0 --post-decode-acwt 10.0 \
Expand Down
2 changes: 1 addition & 1 deletion egs/tedlium/s5/local/nnet3/run_tdnn_discriminative.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ if [ $stage -le 5 ]; then
for decode_set in dev test; do
(
num_jobs=`cat data/${decode_set}_hires/utt2spk|cut -d' ' -f2|sort -u|wc -l`
iter=epoch$x.adj
iter=epoch${x}_adj

steps/nnet3/decode.sh --nj $num_jobs --cmd "$decode_cmd" --iter $iter \
--online-ivector-dir exp/nnet3/ivectors_${decode_set} \
Expand Down
2 changes: 1 addition & 1 deletion egs/wsj/s5/local/nnet3/run_lstm_discriminative.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ fi

if [ $stage -le 5 ]; then
for x in `seq $decode_start_epoch $num_epochs`; do
iter=epoch$x.adj
iter=epoch${x}_adj
for lm_suffix in tgpr bd_tgpr; do
graph_dir=exp/tri4b/graph_${lm_suffix}
# use already-built graphs.
Expand Down
2 changes: 1 addition & 1 deletion egs/wsj/s5/local/nnet3/run_tdnn_discriminative.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fi

if [ $stage -le 5 ]; then
for x in `seq $decode_start_epoch $num_epochs`; do
iter=epoch$x.adj
iter=epoch${x}_adj
for lm_suffix in tgpr bd_tgpr; do
graph_dir=exp/tri4b/graph_${lm_suffix}
# use already-built graphs.
Expand Down
5 changes: 4 additions & 1 deletion egs/wsj/s5/steps/nnet3/train_discriminative.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ mkdir -p $dir/log || exit 1;
model_left_context=$(nnet3-am-info $src_model | grep "^left-context:" | awk '{print $2}')
model_right_context=$(nnet3-am-info $src_model | grep "^right-context:" | awk '{print $2}')


# Copy the ivector information
if [ -f $degs_dir/info/final.ie.id ]; then
cp $degs_dir/info/final.ie.id $dir/ 2>/dev/null || true
fi

# copy some things
for f in splice_opts cmvn_opts tree final.mat; do
Expand Down