Solving multiscale dynamical systems by deep learning