3

Enter code here`as crappy a programmer i am, with slight dyslexia, i need every thing code based witten in such a stupid way that even child can understand it. I try to understand how to get input layer into output layer using feed forward but the tutorials online require to much education. My understanding of math is limited. I'm trying to make a simple neural net with one input layer and one output layer. I understand explanations in sentences better than code.

for i = 1 to 2
    input1(i) = input1(i) * weight1(i)
    input1(i) = input2(i) * weight2(i)
next i
for i = 1 to 2
    sum(i) = input1 + input2
next i
for i = 1 to 2
    if sum(i) > 0 then fire.
next i
end
Jeroen Heier
  • 3,520
  • 15
  • 31
  • 32

2 Answers2

3
for i = 1 to 2
    input1(i) = input1(i) * weight1(i)
    input1(i) = input2(i) * weight2(i)
next i

The 1st assignment is redundant since both assignments store in the same variable (array element input1(i)).
Is this a typo? Maybe the 2nd assignment should read input2(i) = ... !

for i = 1 to 2
    sum(i) = input1 + input2
next i

Both sum(1) and sum(2) will hold the same value because the righthandside expression stays the same throughout the loop.

for i = 1 to 2
    if sum(i) > 0 then fire.
next i 

Because both sum(1) and sum(2) hold the same value, this loop will fire 0 or 2 times, but never 1 time only.

Sep Roland
  • 33,889
  • 7
  • 43
  • 76
0

This may be closer to what you are trying:

FOR i = 1 TO 2
    input1(i) = input1(i) * weight1(i)
    input2(i) = input2(i) * weight2(i)
NEXT i
FOR i = 1 TO 2
    sum(i) = input1(i) + input2(i)
NEXT i
FOR i = 1 TO 2
    IF sum(i) > 0 THEN CALL fire
NEXT i
END
eoredson
  • 1,167
  • 2
  • 14
  • 29