Esempio n. 1
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);
            }
Esempio n. 2
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);
            }