Skip to content

Commit

Permalink
Bug fixes and cosmetic changes in Iban recipe. (#746)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayaditya authored and jtrmal committed May 3, 2016
1 parent fde32f8 commit 8305c4c
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 143 deletions.
3 changes: 3 additions & 0 deletions egs/iban/s5/cmd.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export train_cmd="run.pl --max-jobs-run 32"
export decode_cmd="run.pl --max-jobs-run 32"

#export train_cmd="queue.pl"
#export decode_cmd="queue.pl --mem 4G"
64 changes: 41 additions & 23 deletions egs/iban/s5/local/nnet3/run_tdnn.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Combined from from WSJ + RM
# Combined from from WSJ + RM

# this is the standard "tdnn" system, built in nnet3; it's what we use to
# call multi-splice.
Expand All @@ -12,10 +12,11 @@
# If you want to run without GPU you'd have to call train_tdnn.sh with --gpu false,
# --num-threads 16 and --minibatch-size 128.

stage=9
stage=1
train_stage=-10
dir=exp/nnet3/nnet_tdnn_h_sp_4_850_170
. cmd.sh
dir=exp/nnet3/tdnn_1

. ./cmd.sh
. ./path.sh
. ./utils/parse_options.sh

Expand All @@ -31,38 +32,55 @@ fi
local/nnet3/run_ivector_common.sh --stage $stage || exit 1;

if [ $stage -le 9 ]; then
# --splice-indexes "-2,-1,0,1,2 -3,1 -5,3 0 0 " \
# --splice-indexes "-4,-3,-2,-1,0,1,2,3,4 0 -2,2 0 -4,4 0" \

steps/nnet3/train_tdnn.sh --stage $train_stage \
--num-jobs-initial 2 --num-jobs-final 4 \
--splice-indexes "-4,-3,-2,-1,0,1,2,3,4 0 -2,2 0 -4,4 0 0" \
--num-epochs 4 \
--add-layers-period 1 \
--feat-type raw \
--online-ivector-dir exp/nnet3/ivectors_train\
--cmvn-opts "--norm-means=false --norm-vars=false" \
--initial-effective-lrate 0.005 --final-effective-lrate 0.0005 \
--cmd "$decode_cmd" \
--pnorm-input-dim 850 \
--pnorm-output-dim 170 \
--num-jobs-compute-prior 4\
data/train_hires data/lang exp/nnet3/tri3b_ali_sp $dir || exit 1;
echo "$0: creating neural net configs";

# create the config files for nnet initialization
python steps/nnet3/tdnn/make_configs.py \
--feat-dir data/train_hires \
--ivector-dir exp/nnet3/ivectors_train \
--ali-dir exp/nnet3/tri3b_ali_sp \
--relu-dim 256 \
--splice-indexes=" -2,-1,0,1,2 -1,0,1 -1,0,1 -1,0,1 -1,0,1 -1,0,1 0 " \
--use-presoftmax-prior-scale true \
$dir/configs || exit 1;
fi



if [ $stage -le 10 ]; then

steps/nnet3/train_dnn.py --stage $train_stage \
--cmd="$decode_cmd" \
--trainer.optimization.num-jobs-initial 2 \
--trainer.optimization.num-jobs-final 4 \
--trainer.num-epochs 4 \
--trainer.add-layers-period 1 \
--feat.online-ivector-dir exp/nnet3/ivectors_train\
--feat.cmvn-opts "--norm-means=false --norm-vars=false" \
--trainer.num-epochs 2 \
--trainer.optimization.initial-effective-lrate 0.005 \
--trainer.optimization.final-effective-lrate 0.0005 \
--trainer.samples-per-iter 120000 \
--cleanup.preserve-model-interval 10 \
--feat-dir data/train_hires \
--ali-dir exp/nnet3/tri3b_ali_sp \
--lang data/lang \
--dir=$dir || exit 1;
fi


if [ $stage -le 11 ]; then
# this does offline decoding that should give the same results as the real
# online decoding.
graph_dir=exp/tri3b/graph
# use already-built graphs.
steps/nnet3/decode.sh --nj 6 --cmd "$decode_cmd" \
--online-ivector-dir exp/nnet3/ivectors_dev --iter final\
$graph_dir data/dev_hires $dir/decode_dev || exit 1;

fi

if [ $stage -le 11 ]; then
if [ $stage -le 12 ]; then
steps/lmrescore_const_arpa.sh --cmd "$decode_cmd" \
data/lang_test/ data/lang_big/ data/dev \
${dir}/decode_dev ${dir}/decode_dev.rescored
Expand Down
2 changes: 1 addition & 1 deletion egs/iban/s5/local/prepare_lm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e -o pipefail

local/train_lms_srilm.sh --train-text data/train/text data/ data/srilm

nl -nrz -w10 iban/LM/iban-bp-2012.txt | sort -R > data/local/external_text
nl -nrz -w10 corpus/LM/iban-bp-2012.txt | sort -R > data/local/external_text
local/train_lms_srilm.sh --train-text data/local/external_text data/ data/srilm_external

# let's do ngram interpolation of the previous two LMs
Expand Down
Loading

0 comments on commit 8305c4c

Please sign in to comment.