Automatic Model Selection for Neural Networks