Skip to content
Snippets Groups Projects
Commit 2713ee36 authored by Dan Povey's avatar Dan Povey
Browse files

trunk: small script changes (should have been checked in with bottleneck+DNN...

trunk: small script changes (should have been checked in with bottleneck+DNN training setup for BABEL)

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@3465 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 9fa6307f
Branches
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ splice_width=4 # meaning +- 4 frames on each side for second LDA
rand_prune=4.0 # Relates to a speedup we do for LDA.
within_class_factor=0.0001 # This affects the scaling of the transform rows...
# sorry for no explanation, you'll have to see the code.
lda_dim= # This defaults to no dimension reduction.
echo "$0 $@" # Print the command line for logging
......@@ -96,7 +97,8 @@ fi
feats_one="$(echo "$feats" | sed s:JOB:1:g)"
feat_dim=$(feat-to-dim "$feats_one" -) || exit 1;
lda_dim=$[$feat_dim*(1+2*($splice_width))]; # No dim reduction.
# by default: oo dim reduction.
[ -z "$lda_dim" ] && lda_dim=$[$feat_dim*(1+2*($splice_width))];
if [ $stage -le 0 ]; then
echo "$0: Accumulating LDA statistics."
......@@ -111,7 +113,9 @@ echo $feat_dim > $dir/feat_dim
echo $lda_dim > $dir/lda_dim
if [ $stage -le 1 ]; then
nnet-get-feature-transform --within-class-factor=$within_class_factor --dim=$lda_dim $dir/lda.mat $dir/lda.*.acc \
nnet-get-feature-transform --write-cholesky=$dir/cholesky.tpmat \
--within-class-factor=$within_class_factor --dim=$lda_dim \
$dir/lda.mat $dir/lda.*.acc \
2>$dir/log/lda_est.log || exit 1;
rm $dir/lda.*.acc
fi
......
......@@ -65,6 +65,7 @@ parallel_opts="-pe smp 16 -l ram_free=1G,mem_free=1G" # by default we use 16 thr
cleanup=true
egs_dir=
lda_opts=
lda_dim=
egs_opts=
# End configuration section.
......
......@@ -45,6 +45,6 @@ done
$cmd JOB=1:$nj $kwsdir/log/search.JOB.log \
kws-search --strict=$strict --negative-tolerance=-1 \
"ark:gzip -cdf $indices_dir/index.JOB.gz|" ark:$keywords \
"ark,t:|int2sym.pl -f 2 $kwsdatadir/utter_id > $kwsdir/result.JOB"
"ark,t:|int2sym.pl -f 2 $kwsdatadir/utter_id > $kwsdir/result.JOB" || exit 1;
exit 0;
......@@ -85,6 +85,7 @@ case $feat_type in
delta) sifeats="ark,s,cs:apply-cmvn --norm-vars=$norm_vars --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | add-deltas ark:- ark:- |";;
lda) sifeats="ark,s,cs:apply-cmvn --norm-vars=$norm_vars --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | splice-feats $splice_opts ark:- ark:- | transform-feats $alidir/final.mat ark:- ark:- |"
cp $alidir/final.mat $dir
cp $alidir/full.mat $dir 2>/dev/null
;;
*) echo "$0: invalid feature type $feat_type" && exit 1;
esac
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment