Artificial Neural Network "robot"

I don't know neural network maths but I notice that you have two functions generateLayer1Weights() and generateInputWeights() which are used as part of the setup() process - makes things nice and neat.

But then you have all the rest of the code in loop() so it is impossible to see the wood for the trees. Break the code in loop() into a number of short single purpose functions that can be called from loop().

That way you can test each function separately and also see an overview of the process you are trying to implement. Have a look at Planning and Implementing a Program

...R