Generalization of neural networks