Esempio n. 1
0
        public void Iterate(byte[] neurons) // bad iterate lol
        {
            float total = 0;

            for (int i = 0; i < weights.Length; i++)
            {
                float a = SpecialMath.ByteToFloat(neurons[i]);
                a     *= weights[i];
                total += a;
            }

            futurevalue = SpecialMath.FloatToByte(SpecialMath.Sigmoid(total));
        }
Esempio n. 2
0
        public void Iterate(Neuron[] neurons, Neuron neuron)
        {
            float total = 0;

            for (int i = 0; i < weights.Length; i++)
            {
                if (neuron != neurons[i])
                {
                    float a = SpecialMath.ByteToFloat(neurons[i].value);
                    a     *= weights[i];
                    total += a;
                }
            }

            futurevalue = SpecialMath.FloatToByte(SpecialMath.Sigmoid(total));
        }