A Convexity-dependent Two-Phase Training Algorithm for Deep Neural Networks