update weights in neural network using back propagation errors