Table of Contents
Fetching ...

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

Michael Lutter, Christian Ritter, Jan Peters

TL;DR

Problem: learn accurate, extrapolatable dynamics for physically embodied systems with limited data. Approach: Deep Lagrangian Networks (DeLaN) impose a Lagrangian mechanics prior by parameterizing the inertia as $\hat{\mathbf{H}}(\mathbf{q}) = \hat{\mathbf{L}}(\mathbf{q}) \hat{\mathbf{L}}(\mathbf{q})^{T}$ and learning $\hat{\mathbf{g}}(\mathbf{q})$, thereby enforcing the Euler–Lagrange equation with $L = T - V$ and $T = \frac{1}{2} \dot{\mathbf{q}}^{T} \mathbf{H}(\mathbf{q}) \dot{\mathbf{q}}$. Key contributions: a three-headed network topology that encodes the physics, analytic derivations for $d/dt\mathbf{H}$ and $\partial (\dot{\mathbf{q}}^{T} \mathbf{H} \dot{\mathbf{q}})/\partial \mathbf{q}_i$, and end-to-end trainable derivatives enabling real-time control; extensive experiments on simulated and physical robots. Findings: DeLaN achieves lower sample complexity and better extrapolation to unseen trajectories and higher velocities than a standard FF-NN and can match or exceed analytic baselines in several settings, while maintaining physical plausibility. Significance: provides a principled, data-efficient method to fuse physics with deep learning for safe, extrapolative model-based control across diverse mechanical systems, with potential extensions to non-conservative forces.

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

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

TL;DR

Problem: learn accurate, extrapolatable dynamics for physically embodied systems with limited data. Approach: Deep Lagrangian Networks (DeLaN) impose a Lagrangian mechanics prior by parameterizing the inertia as and learning , thereby enforcing the Euler–Lagrange equation with and . Key contributions: a three-headed network topology that encodes the physics, analytic derivations for and , and end-to-end trainable derivatives enabling real-time control; extensive experiments on simulated and physical robots. Findings: DeLaN achieves lower sample complexity and better extrapolation to unseen trajectories and higher velocities than a standard FF-NN and can match or exceed analytic baselines in several settings, while maintaining physical plausibility. Significance: provides a principled, data-efficient method to fuse physics with deep learning for safe, extrapolative model-based control across diverse mechanical systems, with potential extensions to non-conservative forces.

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

Paper Structure

This paper contains 11 sections, 15 equations, 11 figures.

Figures (11)

  • Figure 1: The computational graph of the Deep Lagrangian Network (DeLaN). Shown in blue and green is the neural network with the three separate heads computing $\mathbf{g}(\mathbf{q})$, $\mathbf{l}_{d}(\mathbf{q})$, $\mathbf{l}_{o}(\mathbf{q})$. The orange boxes correspond to the reshaping operations and the derivatives contained in the Euler-Lagrange equation. For training the gradients are backpropagated through all vertices highlighted in orange.
  • Figure 2: (a) Computational graph of the Lagrangian layer. The orange boxes highlight the learnable parameters. The upper computational sub-graph corresponds to the standard network layer while the lower sub-graph is the extension of the Lagrangian layer to simultaneously compute $\partial \mathbf{h}_i / \partial \mathbf{h}_{i-1}$. (b) Computational graph of the chained Lagrangian layer to compute $\mathbf{L}$, $d\mathbf{L}/dt$ and $\partial\mathbf{L}/\partial \mathbf{q}_i$ using a single feed-forward pass.
  • Figure 3: (a) Real-time control loop using a PD-Controller with a feed-forward torque $\bm{\tau}_{FF}$, compensating the system dynamics, to control the joint torques $\bm{\tau}$. The training process reads the joint states and applies torques to learn the system dynamics online. Once a new model becomes available the inverse model $\hat{f}^{-1}$ in the control loop is updated. (b) The simulated 2-dof robot drawing the cosine trajectories. (c) The simulated Barrett WAM drawing the 3d cosine 0 trajectory. (d) The physical Barrett WAM.
  • Figure 4: (a) The torque $\bm{\tau}$ required to generate the characters 'a', 'd' and 'e' in black. Using these samples DeLaN was trained offline and learns the red trajectory. DeLaN can not only learn the desired torques but also disambiguate the individual torque components even though DeLaN was trained on the super-imposed torques. Using Equation \ref{['eq:f_inv']} DeLaN can represent the inertial force $\mathbf{H}\ddot{\mathbf{q}}$ (b), the Coriolis and Centrifugal forces $\mathbf{c}(\mathbf{q}, \dot{\mathbf{q}})$ (c) and the gravitational force $\mathbf{g}(\mathbf{q})$ (d). All components match closely the ground truth data. (e) shows the offline MSE of the feed-forward neural network and DeLaN for each joint.
  • Figure 5: (a) The average performance of DeLaN and the feed forward neural network for each character. The $4$ columns of the boxplots correspond to different numbers of training characters, i.e., $n=1$, $6$, $8$, $10$. (b) The median performance of DeLaN, the feed forward neural network and the analytic baselines averaged over multiple seeds. The shaded areas highlight the 5th and the 95th percentile. (c) The qualitative performance for the analytic baselines, the feed forward neural network and DeLaN. The desired trajectories are shown in red.
  • ...and 6 more figures