Learning stochastic dynamics with statistics-informed neural network