From d698ad7ef05329c0e9968a4d05688f67d4bfe5e4 Mon Sep 17 00:00:00 2001 From: Dan Povey Date: Wed, 13 Jul 2011 00:51:04 +0000 Subject: [PATCH] Some normalizations to ET options. git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@132 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8 --- egs/rm/s1/steps/decode_tri2b.sh | 2 +- egs/rm/s1/steps/decode_tri2b_utt.sh | 2 +- egs/rm/s1/steps/decode_tri2k.sh | 2 +- egs/rm/s1/steps/decode_tri2k_fmllr.sh | 2 +- egs/rm/s1/steps/decode_tri2k_regtree_fmllr.sh | 2 +- egs/rm/s1/steps/decode_tri2k_utt.sh | 2 +- egs/rm/s1/steps/train_tri2b.sh | 2 +- egs/rm/s1/steps/train_tri2k.sh | 2 +- egs/wsj/s1/RESULTS | 7 ++++++- egs/wsj/s1/run.sh | 5 ++--- egs/wsj/s1/steps/decode_tri2k.sh | 2 +- egs/wsj/s1/steps/decode_tri2k_fmllr.sh | 2 +- egs/wsj/s1/steps/decode_tri3k.sh | 2 +- egs/wsj/s1/steps/decode_tri3k_fmllr.sh | 2 +- egs/wsj/s1/steps/train_tri2b.sh | 2 +- egs/wsj/s1/steps/train_tri2k.sh | 2 +- src/gmmbin/gmm-copy-et.cc | 4 ++-- src/gmmbin/gmm-est-et.cc | 4 ++-- src/gmmbin/gmm-init-et.cc | 4 ++-- src/transform/exponential-transform-test.cc | 8 ++++---- src/transform/exponential-transform.cc | 8 ++++---- src/transform/exponential-transform.h | 13 +++++++------ 22 files changed, 43 insertions(+), 38 deletions(-) diff --git a/egs/rm/s1/steps/decode_tri2b.sh b/egs/rm/s1/steps/decode_tri2b.sh index 7d80eac36..25ca859a2 100755 --- a/egs/rm/s1/steps/decode_tri2b.sh +++ b/egs/rm/s1/steps/decode_tri2b.sh @@ -46,7 +46,7 @@ for test in mar87 oct87 feb89 oct89 feb91 sep92; do ( ali-to-post ark:$dir/test_${test}_pre.ali ark:- | \ weight-silence-post 0.0 $silphones $alignmodel ark:- ark:- | \ gmm-post-to-gpost $alignmodel "$defaultfeats" ark:- ark:- | \ - gmm-est-et $spk2utt_opt --normalize-type=mean-and-var --verbose=1 $model $et \ + gmm-est-et $spk2utt_opt --normalize-type=diag --verbose=1 $model $et \ "$sifeats" ark:- ark:$dir/et_${test}.trans ark,t:$dir/et_${test}.warp ) \ 2>$dir/et_${test}.log || exit 1; diff --git a/egs/rm/s1/steps/decode_tri2b_utt.sh b/egs/rm/s1/steps/decode_tri2b_utt.sh index b60dd3dbf..7c6856810 100755 --- a/egs/rm/s1/steps/decode_tri2b_utt.sh +++ b/egs/rm/s1/steps/decode_tri2b_utt.sh @@ -45,7 +45,7 @@ for test in mar87 oct87 feb89 oct89 feb91 sep92; do ( ali-to-post ark:$dir/test_${test}_pre.ali ark:- | \ weight-silence-post 0.0 $silphones $alignmodel ark:- ark:- | \ gmm-post-to-gpost $alignmodel "$defaultfeats" ark:- ark:- | \ - gmm-est-et $spk2utt_opt --normalize-type=mean-and-var --verbose=1 $model $et \ + gmm-est-et $spk2utt_opt --normalize-type=diag --verbose=1 $model $et \ "$sifeats" ark:- ark:$dir/et_${test}.trans ark,t:$dir/et_${test}.warp ) \ 2>$dir/et_${test}.log || exit 1; diff --git a/egs/rm/s1/steps/decode_tri2k.sh b/egs/rm/s1/steps/decode_tri2k.sh index 058ba83e8..c9d082285 100755 --- a/egs/rm/s1/steps/decode_tri2k.sh +++ b/egs/rm/s1/steps/decode_tri2k.sh @@ -47,7 +47,7 @@ for test in mar87 oct87 feb89 oct89 feb91 sep92; do ( ali-to-post ark:$dir/test_${test}_pre.ali ark:- | \ weight-silence-post 0.0 $silphones $alignmodel ark:- ark:- | \ gmm-post-to-gpost $alignmodel "$defaultfeats" ark:- ark:- | \ - gmm-est-et $spk2utt_opt --normalize-type=mean-and-var --verbose=1 $model $et \ + gmm-est-et $spk2utt_opt --normalize-type=diag --verbose=1 $model $et \ "$sifeats" ark:- ark:$dir/et_${test}.trans ark,t:$dir/et_${test}.warp ) \ 2>$dir/et_${test}.log || exit 1; diff --git a/egs/rm/s1/steps/decode_tri2k_fmllr.sh b/egs/rm/s1/steps/decode_tri2k_fmllr.sh index ab7f96d10..c1ae3cab2 100755 --- a/egs/rm/s1/steps/decode_tri2k_fmllr.sh +++ b/egs/rm/s1/steps/decode_tri2k_fmllr.sh @@ -47,7 +47,7 @@ for test in mar87 oct87 feb89 oct89 feb91 sep92; do ( ali-to-post ark:$dir/test_${test}_pass1.ali ark:- | \ weight-silence-post 0.0 $silphones $alignmodel ark:- ark:- | \ gmm-post-to-gpost $alignmodel "$defaultfeats" ark:- ark:- | \ - gmm-est-et $spk2utt_opt --normalize-type=mean-and-var --verbose=1 $model $et \ + gmm-est-et $spk2utt_opt --normalize-type=diag --verbose=1 $model $et \ "$basefeats" ark:- ark:$dir/et_${test}.trans ark,t:$dir/et_${test}.warp ) \ 2>$dir/et_${test}.log || exit 1; diff --git a/egs/rm/s1/steps/decode_tri2k_regtree_fmllr.sh b/egs/rm/s1/steps/decode_tri2k_regtree_fmllr.sh index bdf5c5cf9..7a4fe4aab 100755 --- a/egs/rm/s1/steps/decode_tri2k_regtree_fmllr.sh +++ b/egs/rm/s1/steps/decode_tri2k_regtree_fmllr.sh @@ -52,7 +52,7 @@ for test in mar87 oct87 feb89 oct89 feb91 sep92; do ( ali-to-post ark:$dir/test_${test}_pass1.ali ark:- | \ weight-silence-post 0.0 $silphones $alignmodel ark:- ark:- | \ gmm-post-to-gpost $alignmodel "$defaultfeats" ark:- ark:- | \ - gmm-est-et $spk2utt_opt --normalize-type=mean-and-var --verbose=1 $model $et \ + gmm-est-et $spk2utt_opt --normalize-type=diag --verbose=1 $model $et \ "$basefeats" ark:- ark:$dir/et_${test}.trans ark,t:$dir/et_${test}.warp ) \ 2>$dir/et_${test}.log || exit 1; diff --git a/egs/rm/s1/steps/decode_tri2k_utt.sh b/egs/rm/s1/steps/decode_tri2k_utt.sh index b227271dd..8993ffc19 100755 --- a/egs/rm/s1/steps/decode_tri2k_utt.sh +++ b/egs/rm/s1/steps/decode_tri2k_utt.sh @@ -47,7 +47,7 @@ for test in mar87 oct87 feb89 oct89 feb91 sep92; do ( ali-to-post ark:$dir/test_${test}_pre.ali ark:- | \ weight-silence-post 0.0 $silphones $alignmodel ark:- ark:- | \ gmm-post-to-gpost $alignmodel "$defaultfeats" ark:- ark:- | \ - gmm-est-et $spk2utt_opt --normalize-type=mean-and-var --verbose=1 $model $et \ + gmm-est-et $spk2utt_opt --normalize-type=diag --verbose=1 $model $et \ "$sifeats" ark:- ark:$dir/et_${test}.trans ark,t:$dir/et_${test}.warp ) \ 2>$dir/et_${test}.log || exit 1; diff --git a/egs/rm/s1/steps/train_tri2b.sh b/egs/rm/s1/steps/train_tri2b.sh index 56945e5db..9a8a37902 100755 --- a/egs/rm/s1/steps/train_tri2b.sh +++ b/egs/rm/s1/steps/train_tri2b.sh @@ -33,7 +33,7 @@ spk2utt_opt=--spk2utt=ark:$dir/spk2utt # the utt2spk opt is used by programs that use all the data so give # it the original utt2spk file. utt2spk_opt=--utt2spk=ark:data/train.utt2spk -normtype=mean # et option; could be mean, or none +normtype=offset # et option; could be offset [recommended], or none numiters=30 # Number of iterations of training maxiterinc=20 # Last iter to increase #Gauss on. diff --git a/egs/rm/s1/steps/train_tri2k.sh b/egs/rm/s1/steps/train_tri2k.sh index 86b63f00a..feacd5882 100755 --- a/egs/rm/s1/steps/train_tri2k.sh +++ b/egs/rm/s1/steps/train_tri2k.sh @@ -34,7 +34,7 @@ spk2utt_opt=--spk2utt=ark:$dir/spk2utt # the utt2spk opt is used by programs that use all the data so give # it the original utt2spk file. utt2spk_opt=--utt2spk=ark:data/train.utt2spk -normtype=mean # et option; could be mean, or none +normtype=offset # et option; could be offset [recommended], or none numiters=30 # Number of iterations of training maxiterinc=20 # Last iter to increase #Gauss on. diff --git a/egs/wsj/s1/RESULTS b/egs/wsj/s1/RESULTS index 1b355e036..663535e1a 100644 --- a/egs/wsj/s1/RESULTS +++ b/egs/wsj/s1/RESULTS @@ -126,7 +126,8 @@ exp/decode_tri2e_tgpr_eval92/wer:%WER 14.29 [ 806 / 5641, 155 ins, 79 del, 572 s exp/decode_tri2e_tgpr_eval93/wer:%WER 19.08 [ 656 / 3439, 71 ins, 120 del, 465 sub ] exp/decode_tri2f_tgpr_eval92/wer:%WER 12.23 [ 690 / 5641, 138 ins, 57 del, 495 sub ] exp/decode_tri2f_tgpr_eval93/wer:%WER 17.74 [ 610 / 3439, 68 ins, 85 del, 457 sub ] -# with acwt 1/17: +# with acwt 1/17. note: better here, but wasn't for tri2k, so leaving it at +# 1/16 for these types of features. exp/decode_tri2f_tgpr_eval92/wer:%WER 12.16 [ 686 / 5641, 128 ins, 59 del, 499 sub ] exp/decode_tri2f_tgpr_eval93/wer:%WER 17.56 [ 604 / 3439, 61 ins, 92 del, 451 sub ] @@ -158,6 +159,10 @@ exp/decode_tri2k_tgpr_fmllr_eval93/wer:%WER 13.70 [ 471 / 3439, 71 ins, 60 del, exp/decode_tri2k_tgpr_utt_eval92/wer:%WER 10.41 [ 587 / 5641, 112 ins, 50 del, 425 sub ] exp/decode_tri2k_tgpr_utt_eval93/wer:%WER 14.63 [ 503 / 3439, 67 ins, 65 del, 371 sub ] +exp/decode_tri2k_tgpr_utt_eval92.acwt17/wer:%WER 10.44 [ 589 / 5641, 109 ins, 51 del, 429 sub ] +exp/decode_tri2k_tgpr_utt_eval93.acwt17/wer:%WER 14.77 [ 508 / 3439, 64 ins, 72 del, 372 sub ] + + exp/decode_tri2l_tgpr_eval92/wer:%WER 9.64 [ 544 / 5641, 121 ins, 44 del, 379 sub ] exp/decode_tri2l_tgpr_eval93/wer:%WER 13.72 [ 472 / 3439, 68 ins, 66 del, 338 sub ] exp/decode_tri2l_tgpr_utt_eval92/wer:%WER 12.00 [ 677 / 5641, 141 ins, 60 del, 476 sub ] diff --git a/egs/wsj/s1/run.sh b/egs/wsj/s1/run.sh index 0edbff989..2adb298c7 100644 --- a/egs/wsj/s1/run.sh +++ b/egs/wsj/s1/run.sh @@ -416,9 +416,8 @@ steps/train_sgmm2e.sh || exit 1; (scripts/mkgraph.sh data/G_tg_pruned.fst exp/sgmm2e/tree exp/sgmm2e/final.mdl exp/graph_sgmm2e_tg_pruned || exit 1; for year in 92 93; do scripts/decode.sh --per-spk exp/decode_sgmm2e_tgpr_eval${year} exp/graph_sgmm2e_tg_pruned/HCLG.fst steps/decode_sgmm2e.sh data/eval_nov${year}.scp exp/graph_tri2k_tg_pruned/HCLG.fst -p -# scripts/decode.sh exp/decode_sgmm2e_tgpr_utt_eval${year} exp/graph_sgmm2e_tg_pruned/HCLG.fst steps/decode_sgmm2e.sh data/eval_nov${year}.scp -# scripts/decode.sh --per-spk exp/decode_sgmm2e_fmllr_tgpr_eval${year} exp/graph_sgmm2e_tg_pruned/HCLG.fst steps/decode_sgmm2e_fmllr.sh data/eval_nov${year}.scp + scripts/decode.sh exp/decode_sgmm2e_tgpr_utt_eval${year} exp/graph_sgmm2e_tg_pruned/HCLG.fst steps/decode_sgmm2e.sh data/eval_nov${year}.scp + scripts/decode.sh --per-spk exp/decode_sgmm2e_fmllr_tgpr_eval${year} exp/graph_sgmm2e_tg_pruned/HCLG.fst steps/decode_sgmm2e_fmllr.sh data/eval_nov${year}.scp done )& diff --git a/egs/wsj/s1/steps/decode_tri2k.sh b/egs/wsj/s1/steps/decode_tri2k.sh index df54e5044..62eaf8724 100755 --- a/egs/wsj/s1/steps/decode_tri2k.sh +++ b/egs/wsj/s1/steps/decode_tri2k.sh @@ -74,7 +74,7 @@ gmm-decode-faster --beam=$prebeam --max-active=$max_active --acoustic-scale=$acw (ali-to-post ark:$dir/$job.pre_ali ark:- | \ weight-silence-post 0.0 $silphones $alimodel ark:- ark:- | \ gmm-post-to-gpost $alimodel "$defaultfeats" ark,o:- ark:- | \ - gmm-est-et --normalize-type=mean-and-var $spk2utt_opt $model $et "$sifeats" ark,o:- \ + gmm-est-et --normalize-type=diag $spk2utt_opt $model $et "$sifeats" ark,o:- \ ark:$dir/$job.trans ark,t:$dir/$job.warp ) 2>$dir/et${job}.log feats="ark:splice-feats --print-args=false scp:$scp ark:- | transform-feats $ldamat ark:- ark:- | transform-feats $utt2spk_opt ark:$dir/$job.trans ark:- ark:- |" diff --git a/egs/wsj/s1/steps/decode_tri2k_fmllr.sh b/egs/wsj/s1/steps/decode_tri2k_fmllr.sh index 075582058..93930363e 100755 --- a/egs/wsj/s1/steps/decode_tri2k_fmllr.sh +++ b/egs/wsj/s1/steps/decode_tri2k_fmllr.sh @@ -75,7 +75,7 @@ gmm-decode-faster --beam=$prebeam --max-active=$max_active --acoustic-scale=$acw (ali-to-post ark:$dir/$job.pre_ali ark:- | \ weight-silence-post 0.0 $silphones $alimodel ark:- ark:- | \ gmm-post-to-gpost $alimodel "$defaultfeats" ark,o:- ark:- | \ - gmm-est-et --normalize-type=mean-and-var $spk2utt_opt $model $et "$sifeats" ark,o:- \ + gmm-est-et --normalize-type=diag $spk2utt_opt $model $et "$sifeats" ark,o:- \ ark:$dir/$job.trans ark,t:$dir/$job.warp ) 2>$dir/et${job}.log feats="ark:splice-feats --print-args=false scp:$scp ark:- | transform-feats $ldamat ark:- ark:- | transform-feats $utt2spk_opt ark:$dir/$job.trans ark:- ark:- |" diff --git a/egs/wsj/s1/steps/decode_tri3k.sh b/egs/wsj/s1/steps/decode_tri3k.sh index 1bd0abaca..c6efc20e9 100755 --- a/egs/wsj/s1/steps/decode_tri3k.sh +++ b/egs/wsj/s1/steps/decode_tri3k.sh @@ -74,7 +74,7 @@ gmm-decode-faster --beam=$prebeam --max-active=$max_active --acoustic-scale=$acw (ali-to-post ark:$dir/$job.pre_ali ark:- | \ weight-silence-post 0.0 $silphones $alimodel ark:- ark:- | \ gmm-post-to-gpost $alimodel "$defaultfeats" ark,o:- ark:- | \ - gmm-est-et --normalize-type=mean-and-var $spk2utt_opt $model $et "$sifeats" ark,o:- \ + gmm-est-et --normalize-type=diag $spk2utt_opt $model $et "$sifeats" ark,o:- \ ark:$dir/$job.trans ark,t:$dir/$job.warp ) 2>$dir/et${job}.log feats="ark:splice-feats --print-args=false scp:$scp ark:- | transform-feats $ldamat ark:- ark:- | transform-feats $utt2spk_opt ark:$dir/$job.trans ark:- ark:- |" diff --git a/egs/wsj/s1/steps/decode_tri3k_fmllr.sh b/egs/wsj/s1/steps/decode_tri3k_fmllr.sh index 4054b050a..77aee4e38 100755 --- a/egs/wsj/s1/steps/decode_tri3k_fmllr.sh +++ b/egs/wsj/s1/steps/decode_tri3k_fmllr.sh @@ -75,7 +75,7 @@ gmm-decode-faster --beam=$prebeam --max-active=$max_active --acoustic-scale=$acw (ali-to-post ark:$dir/$job.pre_ali ark:- | \ weight-silence-post 0.0 $silphones $alimodel ark:- ark:- | \ gmm-post-to-gpost $alimodel "$defaultfeats" ark,o:- ark:- | \ - gmm-est-et --normalize-type=mean-and-var $spk2utt_opt $model $et "$sifeats" ark,o:- \ + gmm-est-et --normalize-type=diag $spk2utt_opt $model $et "$sifeats" ark,o:- \ ark:$dir/$job.trans ark,t:$dir/$job.warp ) 2>$dir/et${job}.log feats="ark:splice-feats --print-args=false scp:$scp ark:- | transform-feats $ldamat ark:- ark:- | transform-feats $utt2spk_opt ark:$dir/$job.trans ark:- ark:- |" diff --git a/egs/wsj/s1/steps/train_tri2b.sh b/egs/wsj/s1/steps/train_tri2b.sh index 1781dd282..c484db547 100755 --- a/egs/wsj/s1/steps/train_tri2b.sh +++ b/egs/wsj/s1/steps/train_tri2b.sh @@ -28,7 +28,7 @@ scale_opts="--transition-scale=1.0 --acoustic-scale=0.1 --self-loop-scale=0.1" # The 3 following settings relate to ET. dim=39 # the dim of our features. -normtype=mean +normtype=offset # et option; could be offset [recommended], or none numiters_et=15 # Before this, update et. numiters=35 diff --git a/egs/wsj/s1/steps/train_tri2k.sh b/egs/wsj/s1/steps/train_tri2k.sh index 2de23e16e..71edf9844 100755 --- a/egs/wsj/s1/steps/train_tri2k.sh +++ b/egs/wsj/s1/steps/train_tri2k.sh @@ -27,7 +27,7 @@ scale_opts="--transition-scale=1.0 --acoustic-scale=0.1 --self-loop-scale=0.1" # The 3 following settings relate to ET. dim=40 # the dim of our features. -normtype=mean +normtype=offset # et option; could be offset [recommended], or none numiters_et=15 # Before this, update et. numiters=35 diff --git a/src/gmmbin/gmm-copy-et.cc b/src/gmmbin/gmm-copy-et.cc index 84a0be101..52f00c3a8 100644 --- a/src/gmmbin/gmm-copy-et.cc +++ b/src/gmmbin/gmm-copy-et.cc @@ -59,8 +59,8 @@ int main(int argc, char *argv[]) if (normalize_type != "") { EtNormalizeType nt; - if (normalize_type == "mean") nt = kEtNormalizeMean; - else if (normalize_type == "mean-and-var") nt = kEtNormalizeMeanAndVar; + if (normalize_type == "offset") nt = kEtNormalizeOffset; + else if (normalize_type == "diag") nt = kEtNormalizeDiag; else if (normalize_type == "none") nt = kEtNormalizeNone; // "none" unlikely, since pointless: only allowed if already == none. else KALDI_ERR << "Invalid normalize-type option: " << normalize_type; diff --git a/src/gmmbin/gmm-est-et.cc b/src/gmmbin/gmm-est-et.cc index 62383c958..da9212911 100644 --- a/src/gmmbin/gmm-est-et.cc +++ b/src/gmmbin/gmm-est-et.cc @@ -85,8 +85,8 @@ int main(int argc, char *argv[]) { if (normalize_type != "") { EtNormalizeType nt; - if (normalize_type == "offset" || normalize_type == "mean") nt = kEtNormalizeMean; - else if (normalize_type == "diag" || normalize_type == "mean-and-var") nt = kEtNormalizeMeanAndVar; + if (normalize_type == "offset") nt = kEtNormalizeOffset; + else if (normalize_type == "diag") nt = kEtNormalizeDiag; else if (normalize_type == "none") nt = kEtNormalizeNone; // "none" unlikely, since pointless: only allowed if already == none. else KALDI_ERR << "Invalid normalize-type option: " << normalize_type; diff --git a/src/gmmbin/gmm-init-et.cc b/src/gmmbin/gmm-init-et.cc index 6245c78f8..1d7e7bcdf 100644 --- a/src/gmmbin/gmm-init-et.cc +++ b/src/gmmbin/gmm-init-et.cc @@ -52,8 +52,8 @@ int main(int argc, char *argv[]) } EtNormalizeType norm_type; - if (normalize_type == "offset" || normalize_type == "mean") norm_type = kEtNormalizeMean; - else if (normalize_type == "diag" || normalize_type == "mean-and-var") norm_type = kEtNormalizeMeanAndVar; + if (normalize_type == "offset") norm_type = kEtNormalizeOffset; + else if (normalize_type == "diag") norm_type = kEtNormalizeDiag; else if (normalize_type == "none") norm_type = kEtNormalizeNone; else KALDI_EXIT << "Invalid option --normalize-type=" << normalize_type; diff --git a/src/transform/exponential-transform-test.cc b/src/transform/exponential-transform-test.cc index be8fc43ab..d1e14249b 100644 --- a/src/transform/exponential-transform-test.cc +++ b/src/transform/exponential-transform-test.cc @@ -186,8 +186,8 @@ void UnitTestExponentialTransformUpdate(EtNormalizeType norm_type, << like_tot; last_like_tot = like_tot; } - int32 num_params = nblocks*( 1 + (norm_type== kEtNormalizeMeanAndVar ? 2*dim : - norm_type == kEtNormalizeMean ? dim : 0)) + int32 num_params = nblocks*( 1 + (norm_type== kEtNormalizeDiag ? 2*dim : + norm_type == kEtNormalizeOffset ? dim : 0)) + (update_a ? dim*(dim+1) : 0) + (update_b ? dim*dim : 0); @@ -212,10 +212,10 @@ int main() { for (int i = 0; i < (long_test ? 5 : 1); i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { - UnitTestExponentialTransformUpdate(kEtNormalizeMean, j != 0, k != 0); + UnitTestExponentialTransformUpdate(kEtNormalizeOffset, j != 0, k != 0); if ((j != 0 && k != 0) || long_test) { // trying only a subset of these tests as it's taking // too long - UnitTestExponentialTransformUpdate(kEtNormalizeMeanAndVar, j != 0, k != 0); + UnitTestExponentialTransformUpdate(kEtNormalizeDiag, j != 0, k != 0); UnitTestExponentialTransformUpdate(kEtNormalizeNone, j != 0, k != 0); } } diff --git a/src/transform/exponential-transform.cc b/src/transform/exponential-transform.cc index b412552e0..1babf4145 100644 --- a/src/transform/exponential-transform.cc +++ b/src/transform/exponential-transform.cc @@ -245,12 +245,12 @@ ComputeTransform(const FmllrDiagGmmAccs &accs_in, Ds_new.SetUnit(); BaseFloat objf_impr; - if (norm_type_ == kEtNormalizeMean) { + if (norm_type_ == kEtNormalizeOffset) { objf_impr = ComputeFmllrMatrixDiagGmmOffset(Ds_new, accs, &Ds_new); } else { - KALDI_ASSERT(norm_type_ == kEtNormalizeMeanAndVar); + KALDI_ASSERT(norm_type_ == kEtNormalizeDiag); objf_impr = ComputeFmllrMatrixDiagGmmDiagonal(Ds_new, accs, &Ds_new); @@ -483,8 +483,8 @@ void ExponentialTransformAccsA::Read(std::istream &os, bool binary, bool add) { void ExponentialTransform::SetNormalizeType(EtNormalizeType norm_type) { - if ((norm_type_ == kEtNormalizeMeanAndVar && norm_type != kEtNormalizeMeanAndVar) - ||( norm_type_ == kEtNormalizeMean && norm_type == kEtNormalizeNone)) + if ((norm_type_ == kEtNormalizeDiag && norm_type != kEtNormalizeDiag) + ||( norm_type_ == kEtNormalizeOffset && norm_type == kEtNormalizeNone)) KALDI_ERR << "SetNormalizeType: trying to reduce the amount of normalization " << "(may not be consistent with transform estimation). "; norm_type_ = norm_type; diff --git a/src/transform/exponential-transform.h b/src/transform/exponential-transform.h index 80e579532..bc3e4952c 100644 --- a/src/transform/exponential-transform.h +++ b/src/transform/exponential-transform.h @@ -37,8 +37,8 @@ namespace kaldi { enum EtNormalizeType { - kEtNormalizeMean, - kEtNormalizeMeanAndVar, + kEtNormalizeOffset, + kEtNormalizeDiag, kEtNormalizeNone }; @@ -65,8 +65,8 @@ class ExponentialTransform { // are of dimension dim+1 // SetNormalizeType sets the normalization type to this. But it only allows - // you to increase the normalization type, i.e. None->Mean or MeanAndVar, - // or Mean->MeanAndVar. + // you to increase the normalization type, i.e. None->Offset or Diag + // or Offset->Diag void SetNormalizeType(EtNormalizeType norm_type); // ComputeTransform does not attempt to work out the objective function change, @@ -82,9 +82,10 @@ class ExponentialTransform { int32 Dim() const { return A_.NumRows() - 1; } // returns feature dim. // Ds is the first term in - // fmllr_mat = W_s = D_s exp(t_s A) B, which is a diagonal-only fMLLR (or possibly + // fmllr_mat = W_s = D_s exp(t_s A) B, which is a diagonal-only + // fMLLR (or possibly // just mean-offset or [ I; 0 ], depending on whether norm_type_ is - // {MeanAndVar, Mean, None}. + // {Diag, Offset, None}. void Write(std::ostream &os, bool binary) const;