Towards Optimal Neural Networks: the Role of Sample Splitting in Hyperparameter Selection