Commit de10f150 authored by Dan Povey's avatar Dan Povey
Browse files

Applied patch from BOLT system.

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4673 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 167e2a67
#!/bin/bash
# This is to be run after run_nnet2_multisplice.sh.
# It demonstrates discriminative training for the online-nnet2 models
. cmd.sh
stage=1
train_stage=-10
use_gpu=true
srcdir=exp/nnet2_online/nnet_ms_a_online
criterion=smbr
learning_rate=0.0016
drop_frames=false # only relevant for MMI
. cmd.sh
. ./path.sh
. ./utils/parse_options.sh
if [ ! -f $srcdir/final.mdl ]; then
echo "$0: expected $srcdir/final.mdl to exist; first run run_nnet2_multisplice.sh."
exit 1;
fi
if $use_gpu; then
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. Otherwise, call this script with --use-gpu false
EOF
fi
parallel_opts="-l gpu=1"
num_threads=1
minibatch_size=512
else
# Use 4 nnet jobs just like run_4d_gpu.sh so the results should be
# almost the same, but this may be a little bit slow.
num_threads=16
minibatch_size=128
parallel_opts="-pe smp $num_threads"
fi
if [ $stage -le 1 ]; then
# use a wide beam because this is RM. These would be too high for other setups.
nj=30
num_threads=6
steps/online/nnet2/make_denlats.sh --cmd "$decode_cmd -l mem_free=1G,ram_free=1G -pe smp $num_threads" \
--nj $nj --sub-split 40 --num-threads "$num_threads" --beam 20.0 --lattice-beam 10.0 \
data/train data/lang $srcdir ${srcdir}_denlats || exit 1;
fi
if [ $stage -le 2 ]; then
# hardcode no-GPU for alignment, although you could use GPU [you wouldn't
# get excellent GPU utilization though.]
nj=100
use_gpu=no
gpu_opts=
steps/online/nnet2/align.sh --cmd "$decode_cmd $gpu_opts" --use-gpu "$use_gpu" \
--nj $nj data/train data/lang $srcdir ${srcdir}_ali || exit 1;
fi
if [ $stage -le 3 ]; then
# I tested the following with --max-temp-archives 3
# to test other branches of the code.
steps/online/nnet2/get_egs_discriminative2.sh \
--cmd "$decode_cmd -pe smp 5" \
--criterion $criterion --drop-frames $drop_frames \
data/train data/lang ${srcdir}{_ali,_denlats,,_degs} || exit 1;
fi
if [ $stage -le 4 ]; then
steps/nnet2/train_discriminative2.sh --cmd "$decode_cmd $parallel_opts" \
--learning-rate $learning_rate \
--criterion $criterion --drop-frames $drop_frames \
--num-epochs 6 \
--num-jobs-nnet 2 --num-threads $num_threads \
${srcdir}_degs ${srcdir}_${criterion}_${learning_rate} || exit 1;
fi
if [ $stage -le 5 ]; then
ln -sf $(readlink -f $srcdir/conf) ${srcdir}_${criterion}_${learning_rate}/conf # so it acts like an online-decoding directory
for epoch in 0 1 2 3 4 5 6; do
steps/online/nnet2/decode.sh --config conf/decode.config --cmd "$decode_cmd" --nj 20 \
--iter epoch$epoch exp/tri3b/graph data/test ${srcdir}_${criterion}_${learning_rate}/decode_epoch$epoch &
steps/online/nnet2/decode.sh --config conf/decode.config --cmd "$decode_cmd" --nj 20 \
--iter epoch$epoch exp/tri3b/graph_ug data/test ${srcdir}_${criterion}_${learning_rate}/decode_ug_epoch$epoch &
done
wait
for dir in ${srcdir}_${criterion}_${learning_rate}/decode*; do grep WER $dir/wer_* | utils/best_wer.sh; done
fi
......@@ -63,7 +63,7 @@ oov=`cat $lang/oov.int` || exit 1;
mkdir -p $dir
cp -r $lang $dir/
cp -rH $lang $dir/
# Compute grammar FST which corresponds to unigram decoding graph.
new_lang="$dir/"$(basename "$lang")
......
......@@ -57,7 +57,7 @@ oov=`cat $lang/oov.int` || exit 1;
mkdir -p $dir
cp -r $lang $dir/
cp -rH $lang $dir/
# Compute grammar FST which corresponds to unigram decoding graph.
new_lang="$dir/"$(basename "$lang")
......
......@@ -66,7 +66,7 @@ oov=`cat $lang/oov.int` || exit 1;
mkdir -p $dir
cp -r $lang $dir/
cp -rH $lang $dir/
# Compute grammar FST which corresponds to unigram decoding graph.
new_lang="$dir/"$(basename "$lang")
......
......@@ -3,12 +3,7 @@
# 2013 Johns Hopkins University (Author: Daniel Povey)
# Apache 2.0
# Computes training alignments using MLP model
# If you supply the "--use-graphs true" option, it will use the training
# graphs from the source directory (where the model is). In this
# case the number of jobs must match with the source directory.
# Computes training alignments using DNN
# Begin configuration section.
nj=4
......
......@@ -53,7 +53,6 @@ if [ $# != 4 ]; then
echo " --splice-width <width;4> # Number of frames on each side to append for feature input"
echo " --left-context <width;4> # Number of frames on left side to append for feature input, overrides splice-width"
echo " --right-context <width;4> # Number of frames on right side to append for feature input, overrides splice-width"
echo " # (note: we splice processed, typically 40-dimensional frames"
echo " --num-frames-diagnostic <#frames;4000> # Number of frames used in computing (train,valid) diagnostics"
echo " --num-valid-frames-combine <#frames;10000> # Number of frames used in getting combination weights at the"
echo " # very end."
......@@ -106,7 +105,7 @@ if [ -f $data/utt2uniq ]; then
fi
awk '{print $1}' $data/utt2spk | utils/filter_scp.pl --exclude $dir/valid_uttlist | \
utils/shuffle_list.pl | head -$num_utts_subset > $dir/train_subset_uttlist || exit 1;
utils/shuffle_list.pl | head -$num_utts_subset > $dir/train_subset_uttlist || exit 1;
[ -z "$transform_dir" ] && transform_dir=$alidir
......@@ -210,7 +209,7 @@ if [ $stage -le 2 ]; then
"ark,s,cs:gunzip -c $dir/ali_special.gz | ali-to-pdf $alidir/final.mdl ark:- ark:- | ali-to-post ark:- ark:- |" \
"ark:$dir/egs/train_subset_all.egs" || touch $dir/.error &
wait;
[ -f $dir/.error ] && exit 1;
[ -f $dir/.error ] && echo "Error detected while creating train/valid egs" && exit 1
echo "Getting subsets of validation examples for diagnostics and combination."
$cmd $dir/log/create_valid_subset_combine.log \
nnet-subset-egs --n=$num_valid_frames_combine ark:$dir/egs/valid_all.egs \
......
......@@ -75,7 +75,6 @@ if [ $# != 3 ]; then
echo " --frames-per-eg <frames;8> # number of frames per eg on disk"
echo " --left-context <width;4> # Number of frames on left side to append for feature input"
echo " --right-context <width;4> # Number of frames on right side to append for feature input"
echo " # (note: we splice processed, typically 40-dimensional frames"
echo " --num-frames-diagnostic <#frames;4000> # Number of frames used in computing (train,valid) diagnostics"
echo " --num-valid-frames-combine <#frames;10000> # Number of frames used in getting combination weights at the"
echo " # very end."
......@@ -236,7 +235,6 @@ if [ $stage -le 2 ]; then
gzip -c >$dir/ali_special.gz || exit 1;
set +o pipefail; # unset the pipefail option.
all_ids=$(seq -s, $nj) # e.g. 1,2,...39,40
$cmd $dir/log/create_valid_subset.log \
nnet-get-egs $ivectors_opt $nnet_context_opts "$valid_feats" \
"ark,s,cs:gunzip -c $dir/ali_special.gz | ali-to-pdf $alidir/final.mdl ark:- ark:- | ali-to-post ark:- ark:- |" \
......@@ -246,7 +244,7 @@ if [ $stage -le 2 ]; then
"ark,s,cs:gunzip -c $dir/ali_special.gz | ali-to-pdf $alidir/final.mdl ark:- ark:- | ali-to-post ark:- ark:- |" \
"ark:$dir/train_subset_all.egs" || touch $dir/.error &
wait;
[ -f $dir/.error ] && exit 1;
[ -f $dir/.error ] && echo "Error detected while creating train/valid egs" && exit 1
echo "... Getting subsets of validation examples for diagnostics and combination."
$cmd $dir/log/create_valid_subset_combine.log \
nnet-subset-egs --n=$num_valid_frames_combine ark:$dir/valid_all.egs \
......
#!/bin/bash
# Copyright 2012 Johns Hopkins University (Author: Daniel Povey). Apache 2.0.
# This script dumps examples MPE or MMI or state-level minimum bayes risk (sMBR)
# training of neural nets. Note: for "criterion", smbr > mpe > mmi in terms of
# compatibility of the dumped egs, meaning you can use the egs dumped with
# --criterion smbr for MPE or MMI, and egs dumped with --criterion mpe for MMI
# training. The discriminative training program itself doesn't enforce this and
# it would let you mix and match them arbitrarily; we area speaking in terms of
# the correctness of the algorithm that splits the lattices into pieces.
# Begin configuration section.
cmd=run.pl
criterion=smbr
drop_frames=false # option relevant for MMI, affects how we dump examples.
samples_per_iter=400000 # measured in frames, not in "examples"
max_temp_archives=128 # maximum number of temp archives per input job, only
# affects the process of generating archives, not the
# final result.
stage=0
cleanup=true
transform_dir= # If this is a SAT system, directory for transforms
online_ivector_dir=
# End configuration section.
echo "$0 $@" # Print the command line for logging
if [ -f path.sh ]; then . ./path.sh; fi
. parse_options.sh || exit 1;
if [ $# != 6 ]; then
echo "Usage: $0 [opts] <data> <lang> <ali-dir> <denlat-dir> <src-model-file> <degs-dir>"
echo " e.g.: $0 data/train data/lang exp/tri3_ali exp/tri4_nnet_denlats exp/tri4/final.mdl exp/tri4_mpe/degs"
echo ""
echo "Main options (for others, see top of script file)"
echo " --config <config-file> # config file containing options"
echo " --cmd (utils/run.pl|utils/queue.pl <queue opts>) # how to run jobs (probably would be good to add -tc 5 or so if using"
echo " # GridEngine (to avoid excessive NFS traffic)."
echo " --samples-per-iter <#samples|400000> # Number of samples of data to process per iteration, per"
echo " # process."
echo " --stage <stage|-8> # Used to run a partially-completed training process from somewhere in"
echo " # the middle."
echo " --criterion <criterion|smbr> # Training criterion: may be smbr, mmi or mpfe"
echo " --online-ivector-dir <dir|""> # Directory for online-estimated iVectors, used in the"
echo " # online-neural-net setup. (but you may want to use"
echo " # steps/online/nnet2/get_egs_discriminative2.sh instead)"
exit 1;
fi
data=$1
lang=$2
alidir=$3
denlatdir=$4
src_model=$5
dir=$6
extra_files=
[ ! -z $online_ivector_dir ] && \
extra_files="$online_ivector_dir/ivector_period $online_ivector_dir/ivector_online.scp"
# Check some files.
for f in $data/feats.scp $lang/L.fst $alidir/ali.1.gz $alidir/num_jobs $alidir/tree \
$denlatdir/lat.1.gz $denlatdir/num_jobs $src_model $extra_files; do
[ ! -f $f ] && echo "$0: no such file $f" && exit 1;
done
mkdir -p $dir/log $dir/info || exit 1;
nj=$(cat $denlatdir/num_jobs) || exit 1; # $nj is the number of
# splits of the denlats and alignments.
nj_ali=$(cat $alidir/num_jobs) || exit 1;
sdata=$data/split$nj
utils/split_data.sh $data $nj
if [ $nj_ali -eq $nj ]; then
ali_rspecifier="ark,s,cs:gunzip -c $alidir/ali.JOB.gz |"
else
ali_rspecifier="scp:$dir/ali.scp"
if [ $stage -le 1 ]; then
echo "$0: number of jobs in den-lats versus alignments differ: dumping them as single archive and index."
all_ids=$(seq -s, $nj_ali)
copy-int-vector --print-args=false \
"ark:gunzip -c $alidir/ali.{$all_ids}.gz|" ark,scp:$dir/ali.ark,$dir/ali.scp || exit 1;
fi
fi
splice_opts=`cat $alidir/splice_opts 2>/dev/null`
silphonelist=`cat $lang/phones/silence.csl` || exit 1;
cmvn_opts=`cat $alidir/cmvn_opts 2>/dev/null`
cp $alidir/splice_opts $dir 2>/dev/null
cp $alidir/cmvn_opts $dir 2>/dev/null
cp $alidir/tree $dir
cp $lang/phones/silence.csl $dir/info/
cp $src_model $dir/final.mdl || exit 1
if [ ! -z "$online_ivector_dir" ]; then
ivector_period=$(cat $online_ivector_dir/ivector_period)
ivector_dim=$(feat-to-dim scp:$online_ivector_dir/ivector_online.scp -) || exit 1;
echo $ivector_dim >$dir/info/ivector_dim
# the 'const_dim_opt' allows it to write only one iVector per example,
# rather than one per time-index... it has to average over
const_dim_opt="--const-feat-dim=$ivector_dim"
else
echo 0 > $dir/info/ivector_dim
fi
## We don't support deltas here, only LDA or raw (mainly because deltas are less
## frequently used).
if [ -z $feat_type ]; then
if [ -f $alidir/final.mat ] && [ ! -f $transform_dir/raw_trans.1 ]; then feat_type=lda; else feat_type=raw; fi
fi
echo "$0: feature type is $feat_type"
case $feat_type in
raw) feats="ark,s,cs:apply-cmvn $cmvn_opts --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- |"
;;
lda)
splice_opts=`cat $alidir/splice_opts 2>/dev/null`
cp $alidir/final.mat $dir
feats="ark,s,cs:apply-cmvn $cmvn_opts --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | splice-feats $splice_opts ark:- ark:- | transform-feats $dir/final.mat ark:- ark:- |"
;;
*) echo "$0: invalid feature type $feat_type" && exit 1;
esac
if [ -z "$transform_dir" ]; then
if [ -f $transform_dir/trans.1 ] || [ -f $transform_dir/raw_trans.1 ]; then
transform_dir=$alidir
fi
fi
if [ ! -z "$transform_dir" ]; then
echo "$0: using transforms from $transform_dir"
[ ! -s $transform_dir/num_jobs ] && \
echo "$0: expected $transform_dir/num_jobs to contain the number of jobs." && exit 1;
nj_orig=$(cat $transform_dir/num_jobs)
if [ $feat_type == "raw" ]; then trans=raw_trans;
else trans=trans; fi
if [ $feat_type == "lda" ] && ! cmp $transform_dir/final.mat $alidir/final.mat; then
echo "$0: LDA transforms differ between $alidir and $transform_dir"
exit 1;
fi
if [ ! -f $transform_dir/$trans.1 ]; then
echo "$0: expected $transform_dir/$trans.1 to exist (--transform-dir option)"
exit 1;
fi
if [ $nj -ne $nj_orig ]; then
# Copy the transforms into an archive with an index.
for n in $(seq $nj_orig); do cat $transform_dir/$trans.$n; done | \
copy-feats ark:- ark,scp:$dir/$trans.ark,$dir/$trans.scp || exit 1;
feats="$feats transform-feats --utt2spk=ark:$sdata/JOB/utt2spk scp:$dir/$trans.scp ark:- ark:- |"
else
# number of jobs matches with alignment dir.
feats="$feats transform-feats --utt2spk=ark:$sdata/JOB/utt2spk ark:$transform_dir/$trans.JOB ark:- ark:- |"
fi
fi
if [ ! -z $online_ivector_dir ]; then
# add iVectors to the features.
feats="$feats paste-feats --length-tolerance=$ivector_period ark:- 'ark,s,cs:utils/filter_scp.pl $sdata/JOB/utt2spk $online_ivector_dir/ivector_online.scp | subsample-feats --n=-$ivector_period scp:- ark:- |' ark:- |"
fi
if [ $stage -le 2 ]; then
echo "$0: working out number of frames of training data"
num_frames=$(steps/nnet2/get_num_frames.sh $data)
echo $num_frames > $dir/info/num_frames
# Working out total number of archives. Add one on the assumption the
# num-frames won't divide exactly, and we want to round up.
num_archives=$[$num_frames/$samples_per_iter + 1]
# the next few lines relate to how we may temporarily split each input job
# into fewer than $num_archives pieces, to avoid using an excessive
# number of filehandles.
archive_ratio=$[$num_archives/$max_temp_archives+1]
num_archives_temp=$[$num_archives/$archive_ratio]
# change $num_archives slightly to make it an exact multiple
# of $archive_ratio.
num_archives=$[$num_archives_temp*$archive_ratio]
echo $num_archives >$dir/info/num_archives || exit 1
echo $num_archives_temp >$dir/info/num_archives_temp || exit 1
frames_per_archive=$[$num_frames/$num_archives]
# note, this is the number of frames per archive prior to discarding frames.
echo $frames_per_archive > $dir/info/frames_per_archive
else
num_archives=$(cat $dir/info/num_archives) || exit 1;
num_archives_temp=$(cat $dir/info/num_archives_temp) || exit 1;
frames_per_archive=$(cat $dir/info/frames_per_archive) || exit 1;
fi
echo "$0: Splitting the data up into $num_archives archives (using $num_archives_temp temporary pieces per input job)"
echo "$0: giving samples-per-iteration of $frames_per_archive (you requested $samples_per_iter)."
# we create these data links regardless of the stage, as there are situations
# where we would want to recreate a data link that had previously been deleted.
if [ -d $dir/storage ]; then
echo "$0: creating data links for distributed storage of degs"
# See utils/create_split_dir.pl for how this 'storage' directory is created.
for x in $(seq $nj); do
for y in $(seq $num_archives_temp); do
utils/create_data_link.pl $dir/degs_orig.$x.$y.ark
done
done
for z in $(seq $num_archives); do
utils/create_data_link.pl $dir/degs.$z.ark
done
if [ $num_archives_temp -ne $num_archives ]; then
for z in $(seq $num_archives); do
utils/create_data_link.pl $dir/degs_temp.$z.ark
done
fi
fi
if [ $stage -le 3 ]; then
echo "$0: getting initial training examples by splitting lattices"
degs_list=$(for n in $(seq $num_archives_temp); do echo ark:$dir/degs_orig.JOB.$n.ark; done)
$cmd JOB=1:$nj $dir/log/get_egs.JOB.log \
nnet-get-egs-discriminative --criterion=$criterion --drop-frames=$drop_frames \
"$src_model" "$feats" "$ali_rspecifier" "ark,s,cs:gunzip -c $denlatdir/lat.JOB.gz|" ark:- \| \
nnet-copy-egs-discriminative $const_dim_opt ark:- $degs_list || exit 1;
sleep 5; # wait a bit so NFS has time to write files.
fi
if [ $stage -le 4 ]; then
degs_list=$(for n in $(seq $nj); do echo $dir/degs_orig.$n.JOB.ark; done)
if [ $num_archives -eq $num_archives_temp ]; then
echo "$0: combining data into final archives and shuffling it"
$cmd JOB=1:$num_archives $dir/log/shuffle.JOB.log \
cat $degs_list \| nnet-shuffle-egs-discriminative --srand=JOB ark:- \
ark:$dir/degs.JOB.ark || exit 1;
else
echo "$0: combining and re-splitting data into un-shuffled versions of final archives."
archive_ratio=$[$num_archives/$num_archives_temp]
! [ $archive_ratio -gt 1 ] && echo "$0: Bad archive_ratio $archive_ratio" && exit 1;
# note: the \$[ .. ] won't be evaluated until the job gets executed. The
# aim is to write to the archives with the final numbering, 1
# ... num_archives, which is more than num_archives_temp. The list with
# \$[... ] expressions in it computes the set of final indexes for each
# temporary index.
degs_list_out=$(for n in $(seq $archive_ratio); do echo "ark:$dir/degs_temp.\$[((JOB-1)*$archive_ratio)+$n].ark"; done)
# e.g. if dir=foo and archive_ratio=2, we'd have
# degs_list_out='foo/degs_temp.$[((JOB-1)*2)+1].ark foo/degs_temp.$[((JOB-1)*2)+2].ark'
$cmd JOB=1:$num_archives_temp $dir/log/resplit.JOB.log \
cat $degs_list \| nnet-copy-egs-discriminative --srand=JOB ark:- \
$degs_list_out || exit 1;
fi
fi
if [ $stage -le 5 ] && [ $num_archives -ne $num_archives_temp ]; then
echo "$0: shuffling final archives."
$cmd JOB=1:$num_archives $dir/log/shuffle.JOB.log \
nnet-shuffle-egs-discriminative --srand=JOB ark:$dir/degs_temp.JOB.ark \
ark:$dir/degs.JOB.ark || exit 1
fi
if $cleanup; then
echo "$0: removing temporary archives."
for x in $(seq $nj); do
for y in $(seq $num_archives_temp); do
file=$dir/degs_orig.$x.$y.ark
[ -L $file ] && rm $(readlink -f $file); rm $file
done
done
if [ $num_archives_temp -ne $num_archives ]; then
for z in $(seq $num_archives); do
file=$dir/degs_temp.$z.ark
[ -L $file ] && rm $(readlink -f $file); rm $file
done
fi
fi
echo "$0: Done."
......@@ -10,16 +10,25 @@ if [ -f path.sh ]; then . ./path.sh; fi
. parse_options.sh || exit 1;
if [ $# -ne 1 ]; then
echo "Usage: $0 <data-dir>"
echo "Prints the number of frames of data in the data-dir, via sampling rather"
echo "than trying to access all the data."
(
echo "Usage: $0 <data-dir>"
echo "Prints the number of frames of data in the data-dir, via sampling rather"
echo "than trying to access all the data."
) 1>&2
fi
data=$1
if [ ! -f $data/feats.scp ]; then
echo "$0: expected $data/feats.scp to exist"
exit 1;
if [ -f $data/segments ]; then
echo "$0: $data/feats.scp does not exist, but $data/segments does exist; using that and assuming 100 frames per second." 1>&2
num_frames=$(cat $data/segments | awk '{x += $4 - $3;} END{print int(x*100);}') || exit 1;
echo $num_frames
exit 0;
else
echo "$0: neither $data/feats.scp nor $data/segments exist." 1>&2
exit 1;
fi
fi
......
......@@ -32,7 +32,7 @@ echo "$0 $@" # Print the command line for logging
if [ $# != 4 ]; then
echo "Usage: steps/make_denlats.sh [options] <data-dir> <lang-dir> <src-dir> <exp-dir>"
echo " e.g.: steps/make_denlats.sh data/train data/lang exp/tri1 exp/tri1_denlats"
echo " e.g.: steps/make_denlats.sh data/train data/lang exp/nnet4 exp/nnet4_denlats"
echo "Works for (delta|lda) features, and (with --transform-dir option) such features"
echo " plus transforms."
echo ""
......@@ -68,14 +68,12 @@ thread_string=
[ $num_threads -gt 1 ] && thread_string="-parallel --num-threads=$num_threads"
mkdir -p $dir/log
[[ -d $sdata && $data/feats.scp -ot $sdata ]] || split_data.sh $data $nj || exit 1;
split_data.sh $data $nj || exit 1;
echo $nj > $dir/num_jobs
oov=`cat $lang/oov.int` || exit 1;
mkdir -p $dir
cp -r $lang $dir/
cp -rH $lang $dir/
# Compute grammar FST which corresponds to unigram decoding graph.
new_lang="$dir/"$(basename "$lang")
......
......@@ -2,10 +2,8 @@
# Copyright 2012 Johns Hopkins University (Author: Daniel Povey). Apache 2.0.
# This script does MPE or fMMI state-level minimum bayes risk (sMBR) training.
# Note: the temporary data is put in <exp-dir>/degs/, so if you want
# to use a different disk for that, just make that a soft link to some other
# volume.
# This script does MPE or MMI or state-level minimum bayes risk (sMBR) training
# of neural nets.
# Begin configuration section.
cmd=run.pl
......@@ -45,7 +43,6 @@ transform_dir=
degs_dir=
retroactive=false
online_ivector_dir=
use_preconditioning=false
# End configuration section.
......@@ -76,7 +73,7 @@ if [ $# != 6 ]; then
echo " # use multiple threads... note, you might have to reduce mem_free,ram_free"
echo " # versus your defaults, because it gets multiplied by the -pe smp argument."
echo " --io-opts <opts|\"-tc 10\"> # Options given to e.g. queue.pl for jobs that do a lot of I/O."
echo " --samples-per-iter <#samples|200000> # Number of samples of data to process per iteration, per"
echo " --samples-per-iter <#samples|400000> # Number of samples of data to process per iteration, per"
echo " # process."
echo " --stage <stage|-8> # Used to run a partially-completed training process from somewhere in"
echo " # the middle."
......@@ -85,6 +82,8 @@ if [ $# != 6 ]; then
echo " --modify-learning-rates <true,false|false> # If true, modify learning rates to try to equalize relative"
echo " # changes across layers."
echo " --degs-dir <dir|""> # Directory for discriminative examples, e.g. exp/foo/degs"
echo " --drop-frames <true,false|false> # Option that affects MMI training: if true, we exclude gradients from frames"
echo " # where the numerator transition-id is not in the denominator lattice."
echo " --online-ivector-dir <dir|""> # Directory for online-estimated iVectors, used in the"
echo " # online-neural-net setup."
exit 1;
......@@ -240,19 +239,17 @@ fi
if [ $stage -le -7 ]; then
echo "$0: Copying initial model and modifying preconditioning setup"
# We want online preconditioning with a larger number of samples of history, since
# in this setup the frames are only randomized at the segment level so they are highly
# correlated. It might make sense to tune this a little, later on, although I doubt
# it matters once it's large enough.
if $use_preconditioning; then
$cmd $dir/log/convert.log \