Esempio n. 1
0
        public void PrepareData()
        {
            InternalArray qint = RunningMean.GetQInt(256);

            RunningMean = qint;
            var cln = RunningVar.Clone();

            for (int i = 0; i < cln.Data.Length; i++)
            {
                cln.Data[i] = (float)Math.Sqrt(cln.Data[i] + eps);
            }
            InternalArray qint2 = cln.GetQInt(256);

            for (int i = 0; i < qint2.QIntData.Length; i++)
            {
                if (qint2.QIntData[i] == 0)
                {
                    qint2.QIntData[i] = 1;
                }
                var q1  = qint2.Unquant(i);
                var err = Math.Abs(q1 - Math.Sqrt(RunningVar.Data[i] + eps));
                if (err > 0.1)
                {
                }
            }
            RunningVar = qint2;

            InternalArray qint3 = Bias.GetQInt(256);

            Bias = qint3;
            InternalArray qint4 = Weight.GetQInt(256);

            Weight = qint4;
        }
Esempio n. 2
0
        public void PrepareData()
        {
            if (Bias != null)
            {
                InternalArray qint3 = Bias.GetQInt(256);
                Bias = qint3;
            }
            InternalArray qint4 = Weight.GetQInt(256);

            Weight = qint4;
        }