learning procedure for neural networks