Neural network with multiple layer: learning function
Here are some questions to help with the implementation of the algorithm:

1- You did the sum, but where/what is the activation function (sigmoid, hyperbolic tangent, Gaussian, etc.)?

2- Is multilayer? How did you forward? Did you use the sum along with activation of each neuron past for the other layers?

3- Have you stored the derivatives of activations to the backpropagation?

4- Will you use the traditional backpropagation algorithm or genetic algorithm to adjust the network weights?

5- If you choose the sigmoid and backpropagation, here is an example algorithm (this algorithm the derivative of the sigmoid is already calculated $O_{j}$ $(1-O_{j})$.