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

[hts-users:02302] A bug in HInit.c


Hi all,

My colleague had a problem in HInit (No path found n xxx'th segment). Usually this problem happens when feature extraction fails. However, we could not find any problems in our training data. I looked at its source code and found a bug in HInit.c:UniformSegment(): mixture (MSD space) weights were not floored at the first stage of HInit. This is sometimes critical because of hard-decision nature of MSD. I attached a patch code to fix this problem.

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 ______________________________________________________________________
--- HInit.c	2008-08-07 13:36:19.347068000 +0000
+++ HInit.c	2009-12-03 18:26:56.283965000 +0000
@@ -639,6 +639,9 @@
    Vector floor;
    SpaceInfo *si;
 
+   void FloorMixes  (MixtureElem *mixes, const int M, const float floor);
+   void FloorTMMixes(Vector mixes,       const int M, const float floor);
+
    if (trace & T_UNI)
       printf(" Uniform Segmentation\n");
    seqMat = CreateSeqMat();
@@ -683,7 +686,7 @@
                   HError(2123,"UniformSegment: different covkind within a mix\n");
                c = cset->cl+m;
                if (uFlags&UPMIXES)
-                        sti->spdf.cpdf[si->sindex[m]].weight = (float)c->csize/(float)sumItems;
+                        sti->spdf.cpdf[si->sindex[m]].weight = (float)((double)c->csize/(double)sumItems);
                if (uFlags&UPMEANS)
                         CopyRVector(c->vCtr,mp->mean,si->order);
                      if (uFlags&UPVARS){
@@ -710,6 +713,7 @@
                   }
                }
             }
+            FloorMixes(sti->spdf.cpdf+1,M,mixWeightFloor);
             break;
          case DISCRETEHS:
             size = hset.swidth[s];
@@ -764,6 +768,7 @@
                      HError(2124,"UniformSegment: bad cov kind %d\n",ck);
                   }                 
             }
+            FloorTMMixes(sti->spdf.tpdf,M,mixWeightFloor);
             break;       
          }
          ResetHeap(&clustSetStack);