[Subject Prev][Subject Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hts-users:02363] A bug in HTrain.c


Hi,

I found a bug in HTrain.c:LoadStateOcc(). It ignores state occupancy counts which are loaded by the previous LoadStateOcc() calls. This bug affects state occupancy counts in stats files if you run HERest in parallel mode with a stream-shared mmf file to generate stats files.

Please apply the attached patch file to fix this problem. Note that this bug exists both in HTS-2.1 & 2.1.1beta.

Best regards,

Heiga ZEN (Byung Ha CHUN)

--
--------------------------
Heiga ZEN (Byung Ha CHUN)
Speech Technology Group
Cambridge Research Lab
Toshiba Research Europe
phone: +44 1223 436975


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
--- HTrain.c	2009-08-18 13:18:33.580905000 +0000
+++ HTrain.c	2010-01-10 13:00:59.835432000 +0000
@@ -1580,25 +1580,27 @@
             DumpVaAcc(f,((VaAcc *)GetHook(mp->cov.var))+index,mp->ckind);
          }
       }
    }    
    return f;
 }
 
 /* LoadStateOcc: new state occ from file f */
 static void LoadStateOcc(Source *src, HMMSet *hset, StateInfo *si)
 {
-   float occ;
+   float tocc,socc;
 
    if (hset->numSharedStreams>0) {
-      ReadFloat(src,&occ,1,ldBinary);
-      memcpy(&(si->hook),&occ,sizeof(float));
+      memcpy(&tocc,&(si->hook),sizeof(float));
+      ReadFloat(src,&socc,1,ldBinary);
+      tocc += socc;
+      memcpy(&(si->hook),&tocc,sizeof(float));
    }
 }
 
 /* LoadWtAcc: new inc of wt acc from file f */
 static void LoadWtAcc(Source *src, WtAcc *wa, int numMixtures)
 {
    int m;
    float f;
    Vector cTemp;