jister
October 24, 2014, 2:01pm
1
trying to make a neural network as in: C# Artificial Intelligence (AI) Programming: A Basic Object Oriented (OOP) Framework for Neural Networks
my do/while loop is crashing the system:
do
{
count++;
net.LearningRate = 3;
net.Train(input, output, TrainingType.BackPropogation, iterations);
net.PerceptionLayer[0].Output = low;
net.PerceptionLayer[1].Output = low;
net.Pulse();
ll = net.OutputLayer[0].Output;
net.PerceptionLayer[0].Output = high;
net.PerceptionLayer[1].Output = low;
net.Pulse();
hl = net.OutputLayer[0].Output;
net.PerceptionLayer[0].Output = low;
net.PerceptionLayer[1].Output = high;
net.Pulse();
lh = net.OutputLayer[0].Output;
net.PerceptionLayer[0].Output = high;
net.PerceptionLayer[1].Output = high;
net.Pulse();
hh = net.OutputLayer[0].Output;
Debug.Log (“Output”+" / “+hh+” / “+ll+” / “+hl+” / "+lh);
#regionverbose
if (verbose)
{
bld.Remove(0, bld.Length);
bld.Append(“PERCEPTION LAYER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n”);
foreach (Neuronpninnet.PerceptionLayer)
AppendNeuronInfo(bld, pn);
bld.Append(“\nHIDDEN LAYER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n”);
foreach (Neuronhninnet.HiddenLayer)
AppendNeuronInfo(bld, hn);
bld.Append(“\nOUTPUT LAYER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n”);
foreach (Neurononinnet.OutputLayer)
AppendNeuronInfo(bld, on);
bld.Append(“\n”);
bld.Append(“hh: \t”).Append(hh.ToString()).Append(“\t< .5\n”);
bld.Append(“ll: \t”).Append(ll.ToString()).Append(“\t< .5\n”);
bld.Append(“hl: \t”).Append(hl.ToString()).Append(“\t> .5\n”);
bld.Append(“lh: \t”).Append(lh.ToString()).Append(“\t> .5\n”);
Debug.Log(bld.ToString());
}
#endregion
}
//reallytrainthisthingwell…
while (hh > 0.5
|| lh < 0.5
|| hl < 0.5
|| ll > 0.5);
if i change the while to:
i get the results from hh, lh, hl, ll i want (hh<0.5, lh>0.5, hl>0.5, ll<0.5) for the other while loop to stop. So whats wrong? why does it crash if i ask for the result i get after running the do ca.100 times?
jister
October 24, 2014, 2:48pm
2
hmm on a second look at my result … hl stays < then 0.5 even after 10 000 iterations…