Regularization, Adaptation and Generalization of Neural Networks