Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
1f51ef5
[egs] Add soft link for mini-librispeech setup
danpovey Apr 23, 2017
60d5f87
[src,scripts] Some convolution-related fixes: now learning rates are …
danpovey Apr 25, 2017
526301b
[src,egs,scripts] Minor fixes; new example script with CNNs (no resul…
danpovey Apr 25, 2017
90fa5e3
[scripts,egs] Various nnet3/chain script simplifications; new cifar e…
danpovey Apr 25, 2017
06047be
[src] Minor bug-fixes in compute-wer-bootci and WSJ run.sh. Thanks: …
jtrmal Apr 25, 2017
5c16793
[scripts] Bug-fix to previous commit about simplifying nnet3 scripts
danpovey Apr 25, 2017
8b9e874
[egs] bug-fix in egs/ami/s5/run_ihm.sh (#1577)
felixs8696 Apr 25, 2017
729fe3d
[scripts] image recognition: add script to transform matrix to png im…
YiwenShaoStephen Apr 25, 2017
ed94788
[scripts] Another fix to previously checked-in simplification of nnet…
danpovey Apr 25, 2017
2217015
[src] Fix test failure in nnet-derivative-test.cc
danpovey Apr 26, 2017
0a5f635
[egs] some fixes re CIFAR data preparation (#1579)
hhadian Apr 26, 2017
e17c1ee
[src] Possible fix for bug found by Gaofeng Cheng
danpovey Apr 26, 2017
4fd7f00
[src,scripts] Add 'test mode' to dropout component (#1578)
freewym Apr 26, 2017
6d948a2
[egs] cifar egs: fixes re CIFAR image to matrix (#1580)
hhadian Apr 26, 2017
780f5b5
[scripts] Add select_image_in_egs.py to easily see augmented images (…
hhadian Apr 26, 2017
3e1d69b
[egs] Clarifying comment.
danpovey Apr 26, 2017
3786beb
[scripts] Image recognition: debugging-related scripts.
YiwenShaoStephen Apr 26, 2017
1d5d9de
[scripts] Add image-augmentation option to train_raw_dnn.py (#1585)
hhadian Apr 27, 2017
932c88b
[src] Add dropout to Xconfig (#1589)
hhadian Apr 28, 2017
f8f64cf
[src,scripts,egs] Change how combination works with batch-norm; add b…
danpovey Apr 28, 2017
a39e580
[build] Remove warning about dash (I believe we have no problem with …
danpovey Apr 28, 2017
4e783ac
[egs] Add new CIFAR example script
danpovey Apr 28, 2017
e4a5af1
[src] Changing how batch-norm stats are recomputed so that training c…
danpovey Apr 28, 2017
cfe1ecc
[egs] Fix mode on cifar script
danpovey Apr 29, 2017
fd76df6
[src] Remove the GetLinearSymbolSequences() function (#1594)
vdp Apr 29, 2017
48bb3e6
[src] Small fix to how combination+batch-norm works (RE output-xent b…
danpovey Apr 29, 2017
6a4c50e
[scripts] Improving how shell commands are called from python (#1595)
danpovey Apr 30, 2017
0dea4ad
[egs] add results for cifar100 in run_cnn_1e.sh (#1599)
keli78 May 1, 2017
868c044
Merge remote-tracking branch 'upstream/master' into kaldi_52
danpovey May 1, 2017
fc20b76
[egs] fix small bug in wsj run.sh [thanks: Hang Lv]
danpovey May 1, 2017
81b2444
Merge remote-tracking branch 'upstream/master' into kaldi_52
danpovey May 1, 2017
810b35d
[src,egs] Changes to image augmentation code; example script in CIFAR…
hhadian May 1, 2017
e527572
[sripts] extract_ivectors.sh: cosmetic fix, correct example usage. (#…
jtrmal May 1, 2017
1cd6d2a
[egs] mini-librispeech: download data from openslr if it's not presen…
galv May 2, 2017
3834fbd
[egs] adding more results/docs for experiments
danpovey May 2, 2017
a57c169
[scripts] Remove some deprecated options
danpovey May 2, 2017
010c556
[src] Refactor wave-reading code, un-support non-16-bit PCM, support …
kkm000 May 3, 2017
6193015
[egs,src] Add another augmentation experiment script; ad final-combin…
hhadian May 3, 2017
f29da2a
[scripts] Fix subtle threading problem causing python script to wait …
danpovey May 4, 2017
3906ae9
[src] bug-fix for memory bug in nnet computation cache code
danpovey May 4, 2017
3eaae47
Merge remote-tracking branch 'upstream/master' into kaldi_52
danpovey May 4, 2017
223a835
[scripts] Script fix w.r.t idct layer in xconfigs, only affects when …
GaofengCheng May 5, 2017
18648cd
Revert "[scripts] Script fix w.r.t idct layer in xconfigs, only affec…
danpovey May 5, 2017
ba13848
[src] Fix bug that can cause crash for for kernel-sizes=n*65536.
danpovey May 5, 2017
60b522d
[scripts] Fix bug in xconfig scripts when idct and lda are both used …
GaofengCheng May 5, 2017
13b08e4
[src] Add --fill-mode option in nnet3-egs-augment-image.cc (#1602)
YiwenShaoStephen May 5, 2017
ad6491a
[src] Add --write-per-frame-acoustic-loglikes options to alignment pr…
naxingyu May 5, 2017
e593f73
Merge remote-tracking branch 'upstream/master' into kaldi_52
danpovey May 5, 2017
7c04d62
[scripts] nnet1: minor update i-vector and mpe scripts (#1607)
KarelVesely84 May 6, 2017
d4c2fb4
[src] Minor fixes to nnet3-egs-augment-image.cc
danpovey May 7, 2017
578c176
[src] cosmetic change to const-arpa-lm-building code; remove too-gene…
hainan-xv May 7, 2017
6eebc04
[src,scripts,egs] Segmenting long erroneous recordings (#1167)
vimalmanohar May 9, 2017
7201337
[src] Fix bug found by Hainan and Yiming regarding looped computation…
danpovey May 11, 2017
ab5c96c
[egs] thchs30 cmd and stage bug fix (#1619)
naxingyu May 11, 2017
d2d0738
[src,scripts,egs] Implement and tune resnets. (#1620)
danpovey May 13, 2017
b1e8601
[src] Change to GPU synchronization, for speed (disables GPU stats by…
danpovey May 13, 2017
8cbb74c
[src] Fix template instantiation bug causing failure if DOUBLEPRECISI…
danpovey May 13, 2017
480ea35
Merging master into kaldi_52 (#1621)
danpovey May 13, 2017
6666682
[egs,scripts] Updates to BUT-specific cmd.sh settings (affects only B…
KarelVesely84 May 15, 2017
a7e6183
[src] fix a small bug: logging cuda elapsed time (#1623)
LvHang May 15, 2017
32dc7fe
[egs,scripts] Add, and use the --proportional-shrink option (approxim…
danpovey May 17, 2017
e727fa0
Changing proportional-shrink from 120 to 150 in mini-librispeech exam…
danpovey May 17, 2017
7af2128
[src,scripts,egs] Add capability for multilingual training with nnet…
pegahgh May 17, 2017
a18a40d
[src,egs,scripts] Add SVHN example; fix asymmetry in image-augmentati…
danpovey May 18, 2017
9638950
[doc] small fix RE queue configuration.
danpovey May 18, 2017
da179a1
[egs] Adding --proportional-shrink example for WSJ.
danpovey May 19, 2017
ae45ee2
[scripts] Fix to long-utterance segmentation script (#1631)
vimalmanohar May 20, 2017
5934056
[egs] Further tuning of --proportional-shrink in WSJ
danpovey May 20, 2017
45ee31f
[src] Make parsing error-msg more informative (thanks: Stefan-Adrian …
danpovey May 20, 2017
b13f56b
[src] fix regarding first/last chunk's right-context in chain models …
hhadian May 21, 2017
86766bd
[scripts, egs]: fix to egs/lre07/v2 (test was trained on); other upda…
s-mousmita May 21, 2017
dc32e0b
[scripts] Fix steps/cleanup/make_biased_lm_graphs.sh to actually add …
Gastron May 22, 2017
d6cf1bd
[scripts,egs] Fixes to long-recording segmentation (#1639)
vimalmanohar May 23, 2017
b5eac09
[scripts] fix bugs in align_basis_fmllr.sh [thanks: Filip Jurcicek]
danpovey May 24, 2017
ec8dec6
[src,scripts,egs] Merge master into kaldi_52 (#1628)
danpovey May 24, 2017
0f5e16e
[build] Check python version is 2.7*, not just 2.*.
danpovey May 25, 2017
31683a3
[build] Change check_dependencies.sh to not look for yum if apt-get p…
danpovey May 25, 2017
6739d60
[scripts] Make more informative error in validate_lang.pl when path.s…
danpovey May 25, 2017
6922c15
[src] Add extra diagnostic in nnet3-show-progress
danpovey May 25, 2017
6cc8e3a
[src] Use STL thread support library instead of pthread. (#1350)
dogancan May 26, 2017
c210b44
[scripts] Fix bugs in automatic report generation for nnet3 training
osadj May 26, 2017
c9d7ccf
[scripts] python3 compatibility: decode the output of get_command_std…
osadj May 26, 2017
76c8c77
[egs] Ported Fisher spanish recipe to use new LDC dir structure. Othe…
noisychannel May 26, 2017
6b906a3
[egs] updated the LDC web address for wsj0-train-spkrinfo.txt (#1648)
osadj May 26, 2017
0b0dbb0
[scripts,egs] minor script fix; fixes in various recipes (#1649)
jtrmal May 26, 2017
b6c34db
[scripts] Lexicon expansion script -- fix for LM-probs, make it work …
jtrmal May 26, 2017
e9646f0
[src] keyword search: fix invalid assumption about the end states (#1…
jtrmal May 27, 2017
93c069c
[src] Fix bug in newly refactored threading code
danpovey May 27, 2017
7267281
[scripts] Getting egs, limit max open filehandles to 512 (thanks: gao…
danpovey May 28, 2017
21d11ff
[egs] adding proportional-shrink scripts to AMI (#1654)
GaofengCheng May 29, 2017
b68c428
Merge remote-tracking branch 'upstream/master' into kaldi_52
danpovey May 29, 2017
1de7f9e
Merge pull request #1656 from danpovey/kaldi_52_merge_master
danpovey May 29, 2017
393ef73
[build] Upgrade .version (this is official start of kaldi 5.2)
danpovey May 29, 2017
cb7d176
Merge pull request #1547 from kaldi-asr/kaldi_52
danpovey May 29, 2017
a57eab6
[scripts] Fix bug in PR #1646 (#1658)
osadj May 30, 2017
972efd7
[scripts] nnet3 script cleanups; add --proportional-shrink in more pl…
danpovey May 31, 2017
3e57783
[src] minor bugfix in convolutional component (doesn't affect experim…
danpovey May 31, 2017
44cd386
[build,scripts] Update scripts that make version info; remove no-op o…
danpovey May 31, 2017
fa198bb
[scripts] do not fail if the ivector extractor belongs to different u…
jtrmal Jun 1, 2017
bd5fd04
[src] keyword search tools: fix Minimize() call, necessary due to Ope…
jtrmal Jun 1, 2017
ada5c0d
[src,scripts] Use ConstFst or decoding (half the memory; slightly fas…
LvHang Jun 2, 2017
cdb25d1
[scripts] make errors getting report non-fatal (thx: Miguel Jette); a…
danpovey Jun 2, 2017
7728a10
[src] Fix bug in online2-nnet3 decoding RE dropout+batch-norm (thanks…
danpovey Jun 2, 2017
6fe140a
[src] Add #include missing from previous commit
danpovey Jun 2, 2017
7b9bf50
[src] Adding model-collapsing code.
danpovey Jun 7, 2017
086fd52
bug-fix
danpovey Jun 7, 2017
3ed9ea2
[src] various bug-fixes/documentation to model collapsing code, use i…
danpovey Jun 7, 2017
589025b
[scripts] Adding updated TDNN script for mini-librispeech, with batch…
danpovey Jun 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 7 additions & 14 deletions egs/ami/s5/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,19 @@

export train_cmd="queue.pl --mem 1G"
export decode_cmd="queue.pl --mem 2G"
# the use of cuda_cmd is deprecated but it is sometimes still used in nnet1
# scripts.
# the use of cuda_cmd is deprecated, used only in 'nnet1',
export cuda_cmd="queue.pl --gpu 1 --mem 20G"

# the rest of this file is present for historical reasons.
# In general it's best to rely on conf/queue.conf for cluster-specific
# configuration.
if [ "$(hostname -d)" == "fit.vutbr.cz" ]; then
queue_conf=$HOME/queue_conf/default.conf # see example /homes/kazi/iveselyk/queue_conf/default.conf,
export train_cmd="queue.pl --config $queue_conf --mem 2G --matylda 0.2"
export decode_cmd="queue.pl --config $queue_conf --mem 3G --matylda 0.1"
export cuda_cmd="queue.pl --config $queue_conf --gpu 1 --mem 10G --tmp 40G"
fi

# On Eddie use:
#export train_cmd="queue.pl -P inf_hcrc_cstr_nst -l h_rt=08:00:00"
#export decode_cmd="queue.pl -P inf_hcrc_cstr_nst -l h_rt=05:00:00 -pe memory-2G 4"
#export highmem_cmd="queue.pl -P inf_hcrc_cstr_nst -l h_rt=05:00:00 -pe memory-2G 4"
#export scoring_cmd="queue.pl -P inf_hcrc_cstr_nst -l h_rt=00:20:00"

if [ "$(hostname -d)" == "fit.vutbr.cz" ]; then
# BUT cluster:
queue="all.q@@blade,all.q@@speech"
storage="matylda5"
export train_cmd="queue.pl -q $queue -l ram_free=1.5G,mem_free=1.5G,${storage}=1"
export decode_cmd="queue.pl -q $queue -l ram_free=2.5G,mem_free=2.5G,${storage}=0.5"
export cuda_cmd="queue.pl -q long.q -l gpu=1"
fi

2 changes: 1 addition & 1 deletion egs/ami/s5/run_ihm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ LM=$final_lm.pr1-7
# Avoiding re-download, using 'wget --continue ...',
if [ $stage -le 0 ]; then
[ -e data/local/downloads/wget_${mic}.sh ] && \
echo "$data/local/downloads/wget_${mic}.sh already exists, better quit than re-download... (use --stage N)" && \
echo "data/local/downloads/wget_${mic}.sh already exists, better quit than re-download... (use --stage N)" && \
exit 1
local/ami_download.sh $mic $AMI_DIR
fi
Expand Down
22 changes: 7 additions & 15 deletions egs/ami/s5b/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,17 @@

export train_cmd="queue.pl --mem 1G"
export decode_cmd="queue.pl --mem 2G"
# the use of cuda_cmd is deprecated but it is sometimes still used in nnet1
# scripts.
# the use of cuda_cmd is deprecated, used only in 'nnet1',
export cuda_cmd="queue.pl --gpu 1 --mem 20G"

# the rest of this file is present for historical reasons.
# In general it's best to rely on conf/queue.conf for cluster-specific
# configuration.
if [ "$(hostname -d)" == "fit.vutbr.cz" ]; then
queue_conf=$HOME/queue_conf/default.conf # see example /homes/kazi/iveselyk/queue_conf/default.conf,
export train_cmd="queue.pl --config $queue_conf --mem 2G --matylda 0.2"
export decode_cmd="queue.pl --config $queue_conf --mem 3G --matylda 0.1"
export cuda_cmd="queue.pl --config $queue_conf --gpu 1 --mem 10G --tmp 40G"
fi

# On Eddie use:
#export train_cmd="queue.pl -P inf_hcrc_cstr_nst -l h_rt=08:00:00"
#export decode_cmd="queue.pl -P inf_hcrc_cstr_nst -l h_rt=05:00:00 -pe memory-2G 4"

if [ "$(hostname -d)" == "fit.vutbr.cz" ]; then
# BUT cluster:
queue="all.q@@blade,all.q@@speech"
gpu_queue="long.q@@gpu"
storage="matylda5"
export train_cmd="queue.pl -q $queue -l ram_free=1.5G,mem_free=1.5G,${storage}=1"
export decode_cmd="queue.pl -q $queue -l ram_free=2.5G,mem_free=2.5G,${storage}=0.5"
export cuda_cmd="queue.pl -q $gpu_queue -l gpu=1"
fi

266 changes: 266 additions & 0 deletions egs/ami/s5b/local/chain/tuning/run_tdnn_1f.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
#!/bin/bash

# same as 1e but uses batchnorm components instead of renorm also adding
# proportional-shrink 10, trained with 4 epochs

# System tdnn1e_sp_bi_ihmali tdnn1f_sp_bi_ihmali
# WER on dev 39.2 37.5
# WER on eval 42.8 41.3
# Final train prob -0.235518 -0.195525
# Final valid prob -0.275605 -0.258708
# Final train prob (xent) -2.75633 -2.42821
# Final valid prob (xent) -2.88854 -2.63458

set -e -o pipefail
# First the options that are passed through to run_ivector_common.sh
# (some of which are also used in this script directly).
stage=0
mic=ihm
nj=30
min_seg_len=1.55
use_ihm_ali=false
train_set=train_cleaned
gmm=tri3_cleaned # the gmm for the target data
ihm_gmm=tri3 # the gmm for the IHM system (if --use-ihm-ali true).
num_threads_ubm=32
ivector_transform_type=pca
nnet3_affix=_cleaned # cleanup affix for nnet3 and chain dirs, e.g. _cleaned

# The rest are configs specific to this script. Most of the parameters
# are just hardcoded at this level, in the commands below.
train_stage=-10
tree_affix= # affix for tree directory, e.g. "a" or "b", in case we change the configuration.
tdnn_affix=1f #affix for TDNN directory, e.g. "a" or "b", in case we change the configuration.
common_egs_dir= # you can set this to use previously dumped egs.

# End configuration section.
echo "$0 $@" # Print the command line for logging

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


if ! cuda-compiled; then
cat <<EOF && exit 1
This script is intended to be used with GPUs but you have not compiled Kaldi with CUDA
If you want to use GPUs (and have them), go to src/, and configure and make on a machine
where "nvcc" is installed.
EOF
fi

local/nnet3/run_ivector_common.sh --stage $stage \
--mic $mic \
--nj $nj \
--min-seg-len $min_seg_len \
--train-set $train_set \
--gmm $gmm \
--num-threads-ubm $num_threads_ubm \
--ivector-transform-type "$ivector_transform_type" \
--nnet3-affix "$nnet3_affix"

# Note: the first stage of the following script is stage 8.
local/nnet3/prepare_lores_feats.sh --stage $stage \
--mic $mic \
--nj $nj \
--min-seg-len $min_seg_len \
--use-ihm-ali $use_ihm_ali \
--train-set $train_set

if $use_ihm_ali; then
gmm_dir=exp/ihm/${ihm_gmm}
ali_dir=exp/${mic}/${ihm_gmm}_ali_${train_set}_sp_comb_ihmdata
lores_train_data_dir=data/$mic/${train_set}_ihmdata_sp_comb
tree_dir=exp/$mic/chain${nnet3_affix}/tree_bi${tree_affix}_ihmdata
lat_dir=exp/$mic/chain${nnet3_affix}/${gmm}_${train_set}_sp_comb_lats_ihmdata
dir=exp/$mic/chain${nnet3_affix}/tdnn${tdnn_affix}_sp_bi_ihmali
# note: the distinction between when we use the 'ihmdata' suffix versus
# 'ihmali' is pretty arbitrary.
else
gmm_dir=exp/${mic}/$gmm
ali_dir=exp/${mic}/${gmm}_ali_${train_set}_sp_comb
lores_train_data_dir=data/$mic/${train_set}_sp_comb
tree_dir=exp/$mic/chain${nnet3_affix}/tree_bi${tree_affix}
lat_dir=exp/$mic/chain${nnet3_affix}/${gmm}_${train_set}_sp_comb_lats
dir=exp/$mic/chain${nnet3_affix}/tdnn${tdnn_affix}_sp_bi
fi

train_data_dir=data/$mic/${train_set}_sp_hires_comb
train_ivector_dir=exp/$mic/nnet3${nnet3_affix}/ivectors_${train_set}_sp_hires_comb
final_lm=`cat data/local/lm/final_lm`
LM=$final_lm.pr1-7


for f in $gmm_dir/final.mdl $lores_train_data_dir/feats.scp \
$train_data_dir/feats.scp $train_ivector_dir/ivector_online.scp; do
[ ! -f $f ] && echo "$0: expected file $f to exist" && exit 1
done


if [ $stage -le 11 ]; then
if [ -f $ali_dir/ali.1.gz ]; then
echo "$0: alignments in $ali_dir appear to already exist. Please either remove them "
echo " ... or use a later --stage option."
exit 1
fi
echo "$0: aligning perturbed, short-segment-combined ${maybe_ihm}data"
steps/align_fmllr.sh --nj $nj --cmd "$train_cmd" \
${lores_train_data_dir} data/lang $gmm_dir $ali_dir
fi

[ ! -f $ali_dir/ali.1.gz ] && echo "$0: expected $ali_dir/ali.1.gz to exist" && exit 1

if [ $stage -le 12 ]; then
echo "$0: creating lang directory with one state per phone."
# Create a version of the lang/ directory that has one state per phone in the
# topo file. [note, it really has two states.. the first one is only repeated
# once, the second one has zero or more repeats.]
if [ -d data/lang_chain ]; then
if [ data/lang_chain/L.fst -nt data/lang/L.fst ]; then
echo "$0: data/lang_chain already exists, not overwriting it; continuing"
else
echo "$0: data/lang_chain already exists and seems to be older than data/lang..."
echo " ... not sure what to do. Exiting."
exit 1;
fi
else
cp -r data/lang data/lang_chain
silphonelist=$(cat data/lang_chain/phones/silence.csl) || exit 1;
nonsilphonelist=$(cat data/lang_chain/phones/nonsilence.csl) || exit 1;
# Use our special topology... note that later on may have to tune this
# topology.
steps/nnet3/chain/gen_topo.py $nonsilphonelist $silphonelist >data/lang_chain/topo
fi
fi

if [ $stage -le 13 ]; then
# Get the alignments as lattices (gives the chain training more freedom).
# use the same num-jobs as the alignments
steps/align_fmllr_lats.sh --nj 100 --cmd "$train_cmd" ${lores_train_data_dir} \
data/lang $gmm_dir $lat_dir
rm $lat_dir/fsts.*.gz # save space
fi

if [ $stage -le 14 ]; then
# Build a tree using our new topology. We know we have alignments for the
# speed-perturbed data (local/nnet3/run_ivector_common.sh made them), so use
# those.
if [ -f $tree_dir/final.mdl ]; then
echo "$0: $tree_dir/final.mdl already exists, refusing to overwrite it."
exit 1;
fi
steps/nnet3/chain/build_tree.sh --frame-subsampling-factor 3 \
--context-opts "--context-width=2 --central-position=1" \
--leftmost-questions-truncate -1 \
--cmd "$train_cmd" 4200 ${lores_train_data_dir} data/lang_chain $ali_dir $tree_dir
fi

xent_regularize=0.1

if [ $stage -le 15 ]; then
echo "$0: creating neural net configs using the xconfig parser";

num_targets=$(tree-info $tree_dir/tree |grep num-pdfs|awk '{print $2}')
learning_rate_factor=$(echo "print 0.5/$xent_regularize" | python)

mkdir -p $dir/configs
cat <<EOF > $dir/configs/network.xconfig
input dim=100 name=ivector
input dim=40 name=input

# please note that it is important to have input layer with the name=input
# as the layer immediately preceding the fixed-affine-layer to enable
# the use of short notation for the descriptor
fixed-affine-layer name=lda input=Append(-1,0,1,ReplaceIndex(ivector, t, 0)) affine-transform-file=$dir/configs/lda.mat

# the first splicing is moved before the lda layer, so no splicing here
relu-batchnorm-layer name=tdnn1 dim=450
relu-batchnorm-layer name=tdnn2 input=Append(-1,0,1) dim=450
relu-batchnorm-layer name=tdnn3 input=Append(-1,0,1) dim=450
relu-batchnorm-layer name=tdnn4 input=Append(-3,0,3) dim=450
relu-batchnorm-layer name=tdnn5 input=Append(-3,0,3) dim=450
relu-batchnorm-layer name=tdnn6 input=Append(-3,0,3) dim=450
relu-batchnorm-layer name=tdnn7 input=Append(-3,0,3) dim=450

## adding the layers for chain branch
relu-batchnorm-layer name=prefinal-chain input=tdnn7 dim=450 target-rms=0.5
output-layer name=output include-log-softmax=false dim=$num_targets max-change=1.5

# adding the layers for xent branch
# This block prints the configs for a separate output that will be
# trained with a cross-entropy objective in the 'chain' models... this
# has the effect of regularizing the hidden parts of the model. we use
# 0.5 / args.xent_regularize as the learning rate factor- the factor of
# 0.5 / args.xent_regularize is suitable as it means the xent
# final-layer learns at a rate independent of the regularization
# constant; and the 0.5 was tuned so as to make the relative progress
# similar in the xent and regular final layers.
relu-batchnorm-layer name=prefinal-xent input=tdnn7 dim=450 target-rms=0.5
output-layer name=output-xent dim=$num_targets learning-rate-factor=$learning_rate_factor max-change=1.5

EOF

steps/nnet3/xconfig_to_configs.py --xconfig-file $dir/configs/network.xconfig --config-dir $dir/configs/
fi

if [ $stage -le 16 ]; then
if [[ $(hostname -f) == *.clsp.jhu.edu ]] && [ ! -d $dir/egs/storage ]; then
utils/create_split_dir.pl \
/export/b0{5,6,7,8}/$USER/kaldi-data/egs/ami-$(date +'%m_%d_%H_%M')/s5b/$dir/egs/storage $dir/egs/storage
fi

steps/nnet3/chain/train.py --stage $train_stage \
--cmd "$decode_cmd" \
--feat.online-ivector-dir $train_ivector_dir \
--feat.cmvn-opts "--norm-means=false --norm-vars=false" \
--chain.xent-regularize $xent_regularize \
--chain.leaky-hmm-coefficient 0.1 \
--chain.l2-regularize 0.00005 \
--chain.apply-deriv-weights false \
--chain.lm-opts="--num-extra-lm-states=2000" \
--egs.dir "$common_egs_dir" \
--egs.opts "--frames-overlap-per-eg 0" \
--egs.chunk-width 150 \
--trainer.num-chunk-per-minibatch 128 \
--trainer.frames-per-iter 1500000 \
--trainer.num-epochs 4 \
--trainer.optimization.num-jobs-initial 2 \
--trainer.optimization.num-jobs-final 12 \
--trainer.optimization.initial-effective-lrate 0.001 \
--trainer.optimization.final-effective-lrate 0.0001 \
--trainer.optimization.proportional-shrink 10 \
--trainer.max-param-change 2.0 \
--cleanup.remove-egs true \
--feat-dir $train_data_dir \
--tree-dir $tree_dir \
--lat-dir $lat_dir \
--dir $dir
fi


graph_dir=$dir/graph_${LM}
if [ $stage -le 17 ]; then
# Note: it might appear that this data/lang_chain directory is mismatched, and it is as
# far as the 'topo' is concerned, but this script doesn't read the 'topo' from
# the lang directory.
utils/mkgraph.sh --self-loop-scale 1.0 data/lang_${LM} $dir $graph_dir
fi

if [ $stage -le 18 ]; then
rm $dir/.error 2>/dev/null || true
for decode_set in dev eval; do
(
steps/nnet3/decode.sh --acwt 1.0 --post-decode-acwt 10.0 \
--nj $nj --cmd "$decode_cmd" \
--online-ivector-dir exp/$mic/nnet3${nnet3_affix}/ivectors_${decode_set}_hires \
--scoring-opts "--min-lmwt 5 " \
$graph_dir data/$mic/${decode_set}_hires $dir/decode_${decode_set} || exit 1;
) || touch $dir/.error &
done
wait
if [ -f $dir/.error ]; then
echo "$0: something went wrong in decoding"
exit 1
fi
fi
exit 0
Loading