Deep Lagrangian Networks: Using Physics as Model Prior for Deep Learning

TL;DR DeLaN builds the Euler-Lagrange equation into a deep network that learns a robot's inertia matrix and gravity from joint positions, and learns it online during real-time control. Trained on 8 of 20 characters on a simulated 2-dof robot, it tracks all 20 about as well as the analytic model, and it handles faster trajectories much better than a standard network.
What they do
Learned inverse-dynamics models extrapolate poorly; analytic models need precise physical parameters. Deep Lagrangian Networks (DeLaN) learn the inertia matrix H(q) and gravity g(q) with deep networks and compute torques from them through the Euler-Lagrange equation. The model is learned online, from random initialization, while it controls the robot.
How it works
- Physics-structured output. One network with three heads outputs g(q) and the diagonal and off-diagonal entries of a lower-triangular L(q), with H = LL^T. A non-negative activation plus a positive constant on the diagonal keeps H positive definite, so the model can also be inverted into a forward model.
- Positions only. L and g depend on q, not on velocities or accelerations, so the learned parameters should, within limits, generalize to new velocities.
- Analytic derivatives in one pass. A “Lagrangian layer” computes each layer’s output and its derivative with respect to its input together, giving dH/dt and the Coriolis term in a single forward pass. Training minimizes torque error end to end, plus an L2 weight penalty because the Lagrangian is not unique.
- Control. The learned feed-forward torque is added to a low-gain PD controller and updated at 200 Hz, so each prediction must finish within 1/200 s.
Results
- On a simulated 2-dof robot, DeLaN trained on total torques recovers inertial, Coriolis/centrifugal and gravity torques that closely match ground truth.
- Trained online on 8 random characters, DeLaN draws all 20 with tracking error comparable to the analytic model with the true simulation parameters; a feed-forward network (FF-NN) deviates significantly.
- Trained at 1x velocity, the FF-NN degrades quickly on faster trajectories while DeLaN keeps good tracking; on the simulated WAM it beats the analytic model at every velocity scale.
- On the physical Barrett WAM (four lower joints), the FF-NN tracks training trajectories best and DeLaN is slightly better than the analytic model, but DeLaN degrades much less at higher velocities.
Limitations
DeLaN inherits the rigid-body assumptions of Lagrangian mechanics, so it cannot represent the WAM’s cable drives and fits the real robot worse than an unstructured network. Model errors grow quadratically with velocity. In offline benchmarks it extrapolates worse than classical system identification, which needs the robot’s kinematics. Only the WAM’s four lower joints were learned.
Figures




Abstract
Deep learning has achieved astonishing results on many tasks with large amounts of data and generalization within the proximity of training data. For many important real-world applications, these requirements are unfeasible and additional prior knowledge on the task domain is required to overcome the resulting problems. In particular, learning physics models for model-based control requires robust extrapolation from fewer samples - often collected online in real-time - and model errors may lead to drastic damages of the system. Directly incorporating physical insight has enabled us to obtain a novel deep model learning approach that extrapolates well while requiring fewer samples. As a first example, we propose Deep Lagrangian Networks (DeLaN) as a deep network structure upon which Lagrangian Mechanics have been imposed. DeLaN can learn the equations of motion of a mechanical system (i.e., system dynamics) with a deep network efficiently while ensuring physical plausibility. The resulting DeLaN network performs very well at robot tracking control. The proposed method did not only outperform previous model learning approaches at learning speed but exhibits substantially improved and more robust extrapolation to novel trajectories and learns online in real-time
Summaries are written automatically from each paper's text. Figures and videos come from the paper and its project page; all credit goes to the authors.
