コード例 #1
0
        private double RandomNumber()
        {
            bool inRange = false;

            byte[] b = new byte[8];

            while (!inRange)
            {
                rng.GetBytes(b);
                double c = BitConverter.ToDouble(b, 0);

                ActivationFunctions af = new ActivationFunctions();
                c = af.ScaledELU(c);

                if (c < 1 && c > -1)
                {
                    return(c);
                }
            }

            return(9);  //Never reached
        }