Adaptively Solving the Local-Minimum Problem for Deep Neural Networks