Commit ad865b0e authored by Vimal Manohar's avatar Vimal Manohar
Browse files

trunk: src/nnet2/nnet-compute-discriminative.cc: Fixed minor bug in computing...

trunk: src/nnet2/nnet-compute-discriminative.cc: Fixed minor bug in computing objective function stats for printing (nan for mmi numerator loglike)

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4914 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 3a9cb90a
......@@ -264,7 +264,7 @@ void NnetDiscriminativeUpdater::LatticeComputations() {
if (opts_.criterion == "mmi") {
double tot_num_like = 0.0;
for (; index < eg_.num_ali.size(); index++)
tot_num_like += log(answers[index]);
tot_num_like += answers[index];
stats_->tot_num_objf += eg_.weight * tot_num_like;
}
......@@ -328,7 +328,7 @@ double NnetDiscriminativeUpdater::GetDiscriminativePosteriors(Posterior *post) {
ans = LatticeForwardBackwardMpeVariants(tmodel_, silence_phones_, lat_,
eg_.num_ali, opts_.criterion,
opts_.one_silence_class,
&tid_post) * eg_.weight;
&tid_post);
ConvertPosteriorToPdfs(tmodel_, tid_post, post);
return ans; // returns the objective function.
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment