Ejemplo n.º 1
0
            public Pool htkVars(string name, float num)
            {
                Pool pool      = new Pool(name);
                int  numStates = this.getNumStates();
                int  value     = 1;
                int  gmmsize   = this.getGMMSize();

                pool.setFeature(Pool.Feature.__NUM_SENONES, numStates);
                pool.setFeature(Pool.Feature.__NUM_STREAMS, value);
                pool.setFeature(Pool.Feature.__NUM_GAUSSIANS_PER_STATE, gmmsize);
                int ncoefs = this.getNcoefs();

                for (int i = 0; i < numStates; i++)
                {
                    GMMDiag gmmdiag = (GMMDiag)this.hmmsHTK.__gmms.get(i);
                    for (int j = 0; j < gmmsize; j++)
                    {
                        float[] array = new float[ncoefs];
                        int     k;
                        for (k = 0; k < ncoefs; k++)
                        {
                            array[k] = gmmdiag.getVar(j, k);
                        }
                        Utilities.floorData(array, HTKLoader.access_000(this.this_0));
                        k = i * gmmsize + j;
                        pool.put(k, array);
                    }
                }
                return(pool);
            }
Ejemplo n.º 2
0
            public GaussianWeights htkWeights(string name, float num)
            {
                int             numStates       = this.getNumStates();
                int             numStreams      = 1;
                int             gmmsize         = this.getGMMSize();
                GaussianWeights gaussianWeights = new GaussianWeights(name, numStates, gmmsize, numStreams);

                for (int i = 0; i < numStates; i++)
                {
                    GMMDiag gmmdiag = (GMMDiag)this.hmmsHTK.__gmms.get(i);
                    float[] array   = new float[gmmsize];
                    for (int j = 0; j < gmmsize; j++)
                    {
                        array[j] = gmmdiag.getWeight(j);
                    }
                    Utilities.floorData(array, HTKLoader.access_100(this.this_0));
                    HTKLoader.access_200(this.this_0).linearToLog(array);
                    gaussianWeights.put(i, 0, array);
                }
                return(gaussianWeights);
            }
Ejemplo n.º 3
0
            public Pool htkTrans(string name)
            {
                Pool pool    = new Pool(name);
                int  numHMMs = this.getNumHMMs();
                int  i       = 0;

                if (this.hmmsHTK.__transitions != null)
                {
                    while (i < this.hmmsHTK.__transitions.size())
                    {
                        float[][] array  = (float[][])this.hmmsHTK.__transitions.get(i);
                        int       num    = array.Length;
                        int       num2   = array[0].Length;
                        int[]     array2 = new int[2];
                        int       num3   = num2;
                        array2[1] = num3;
                        num3      = num;
                        array2[0] = num3;
                        float[][] array3 = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array2);
                        for (int j = 0; j < array3.Length; j++)
                        {
                            for (int k = 0; k < array3[j].Length; k++)
                            {
                                array3[j][k] = HTKLoader.access_200(this.this_0).linearToLog((double)array[j][k]);
                            }
                        }
                        pool.put(i, array3);
                        i++;
                    }
                }
                for (int l = 0; l < numHMMs; l++)
                {
                    SingleHMM hmm = this.hmmsHTK.getHMM(l);
                    if (hmm.trans != null)
                    {
                        float[][] trans  = hmm.trans;
                        int       num4   = trans.Length;
                        int       num5   = trans[0].Length;
                        int[]     array2 = new int[2];
                        int       num3   = num5;
                        array2[1] = num3;
                        num3      = num4;
                        array2[0] = num3;
                        float[][] array4 = (float[][])ByteCodeHelper.multianewarray(typeof(float[][]).TypeHandle, array2);
                        for (int m = 0; m < array4.Length; m++)
                        {
                            for (int n = 0; n < array4[m].Length; n++)
                            {
                                array4[m][n] = HTKLoader.access_200(this.this_0).linearToLog((double)trans[m][n]);
                            }
                        }
                        hmm.trIdx = i;
                        Pool pool2 = pool;
                        int  id    = i;
                        i++;
                        pool2.put(id, array4);
                    }
                    else
                    {
                        hmm.trIdx = hmm.getTransIdx();
                    }
                }
                return(pool);
            }
Ejemplo n.º 4
0
 internal HTKStruct(HTKLoader htkloader)
 {
     this.this_0 = htkloader;
 }
Ejemplo n.º 5
0
 internal static LogMath access_200(HTKLoader htkloader)
 {
     return(htkloader.logMath);
 }
Ejemplo n.º 6
0
 internal static float access_100(HTKLoader htkloader)
 {
     return(htkloader.mixtureWeightFloor);
 }
Ejemplo n.º 7
0
 internal static float access_000(HTKLoader htkloader)
 {
     return(htkloader.varianceFloor);
 }