newtons method for each neuron