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)); }
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)); }