Example #1
0
        protected internal virtual Pool createSenonePool(float distFloor, float varianceFloor)
        {
            Pool pool        = new Pool("senones");
            int  num         = this.meansPool.size();
            int  num2        = this.variancePool.size();
            int  gauPerState = this.mixtureWeights.getGauPerState();
            int  statesNum   = this.mixtureWeights.getStatesNum();
            int  streamsNum  = this.mixtureWeights.getStreamsNum();
            int  num3        = 0;

            this.logger.fine(new StringBuilder().append("Senones ").append(statesNum).toString());
            this.logger.fine(new StringBuilder().append("Gaussians Per Senone ").append(gauPerState).toString());
            this.logger.fine(new StringBuilder().append("Means ").append(num).toString());
            this.logger.fine(new StringBuilder().append("Variances ").append(num2).toString());
            if (!Sphinx3Loader.assertionsDisabled && gauPerState <= 0)
            {
                throw new AssertionError();
            }
            if (!Sphinx3Loader.assertionsDisabled && num2 != statesNum * gauPerState)
            {
                throw new AssertionError();
            }
            if (!Sphinx3Loader.assertionsDisabled && num != statesNum * gauPerState)
            {
                throw new AssertionError();
            }
            float[][] meanTransformationMatrix     = (this.meanTransformationMatrixPool != null) ? ((float[][])this.meanTransformationMatrixPool.get(0)) : ((float[][])null);
            float[]   meanTransformationVector     = (this.meanTransformationVectorPool != null) ? ((float[])this.meanTransformationVectorPool.get(0)) : null;
            float[][] varianceTransformationMatrix = (this.varianceTransformationMatrixPool != null) ? ((float[][])this.varianceTransformationMatrixPool.get(0)) : ((float[][])null);
            float[]   varianceTransformationVector = (this.varianceTransformationVectorPool != null) ? ((float[])this.varianceTransformationVectorPool.get(0)) : null;
            for (int i = 0; i < statesNum; i++)
            {
                MixtureComponent[] array = new MixtureComponent[gauPerState * streamsNum];
                for (int j = 0; j < gauPerState; j++)
                {
                    MixtureComponent[] array2 = array;
                    int num4 = j;
                    array2[num4] = new MixtureComponent((float[])this.meansPool.get(num3), meanTransformationMatrix, meanTransformationVector, (float[])this.variancePool.get(num3), varianceTransformationMatrix, varianceTransformationVector, distFloor, varianceFloor);
                    num3++;
                }
                GaussianMixture o = new GaussianMixture(this.mixtureWeights, array, i);
                pool.put(i, o);
            }
            return(pool);
        }
Example #2
0
        private Pool createSenonePool(float num, float num2)
        {
            Pool pool        = new Pool("senones");
            int  num3        = this.meansPool.size();
            int  num4        = this.variancePool.size();
            int  gauPerState = this.mixtureWeights.getGauPerState();
            int  statesNum   = this.mixtureWeights.getStatesNum();
            int  num5        = 0;

            this.logger.fine(new StringBuilder().append("NG ").append(gauPerState).toString());
            this.logger.fine(new StringBuilder().append("NS ").append(statesNum).toString());
            this.logger.fine(new StringBuilder().append("NMNS ").append(num3).toString());
            this.logger.fine(new StringBuilder().append("NMNS ").append(num4).toString());
            if (!HTKLoader.assertionsDisabled && gauPerState <= 0)
            {
                throw new AssertionError();
            }
            if (!HTKLoader.assertionsDisabled && num4 != statesNum * gauPerState)
            {
                throw new AssertionError();
            }
            if (!HTKLoader.assertionsDisabled && num3 != statesNum * gauPerState)
            {
                throw new AssertionError();
            }
            float[][] meanTransformationMatrix     = (this.meanTransformationMatrixPool != null) ? ((float[][])this.meanTransformationMatrixPool.get(0)) : ((float[][])null);
            float[]   meanTransformationVector     = (this.meanTransformationVectorPool != null) ? ((float[])this.meanTransformationVectorPool.get(0)) : null;
            float[][] varianceTransformationMatrix = (this.varianceTransformationMatrixPool != null) ? ((float[][])this.varianceTransformationMatrixPool.get(0)) : ((float[][])null);
            float[]   varianceTransformationVector = (this.varianceTransformationVectorPool != null) ? ((float[])this.varianceTransformationVectorPool.get(0)) : null;
            for (int i = 0; i < statesNum; i++)
            {
                MixtureComponent[] array = new MixtureComponent[gauPerState];
                for (int j = 0; j < gauPerState; j++)
                {
                    MixtureComponent[] array2 = array;
                    int num6 = j;
                    array2[num6] = new MixtureComponent((float[])this.meansPool.get(num5), meanTransformationMatrix, meanTransformationVector, (float[])this.variancePool.get(num5), varianceTransformationMatrix, varianceTransformationVector, num, num2);
                    num5++;
                }
                GaussianMixture o = new GaussianMixture(this.mixtureWeights, array, i);
                pool.put(i, o);
            }
            return(pool);
        }