Adaptive Deep Neural Network