Computing non-equilibrium trajectories by a deep learning approach