We present a generalized potential theory of nonequilibrium torques for the Landau-Lifshitz equation. The general formulation of exchange forces in terms of two potential energies allows for the implementation of accurate machine learning models for adiabatic spin dynamics of out-of-equilibrium itinerant magnetic systems. To demonstrate our approach, we develop a deep-learning neural network that successfully learns the forces in a driven s-d model computed from the nonequilibrium Green's function method. We show that the Landau-Lifshitz dynamics simulations with forces predicted from the neural-net model accurately reproduce the voltage-driven domain-wall propagation. Our work opens a new avenue for multi-scale modeling of nonequilibrium dynamical phenomena in itinerant magnets and spintronics based on machine-learning models.