Extending Lagrangian and Hamiltonian Neural Networks with Differentiable Contact Models
Authors: Yaofeng Desmond Zhong
Biswadip Dey
Amit Chakraborty
Venue: NeurIPS 2021 Poster (2021)
Keywords: Deep Model Learning
Physics-based Priors
Contact Models

Abstract: The incorporation of appropriate inductive bias plays a critical role in learning dynamics from data. A growing body of work has been exploring ways to enforce energy conservation in the learned dynamics by encoding Lagrangian or Hamiltonian dynamics into the neural network architecture. These existing approaches are based on differential equations, which do not allow discontinuity in the states and thereby limit the class of systems one can learn. However, in reality, most physical systems, such as legged robots and robotic manipulators, involve contacts and collisions, which introduce discontinuities in the states. In this paper, we introduce a differentiable contact model, which can capture contact mechanics: frictionless/frictional, as well as elastic/inelastic. This model can also accommodate inequality constraints, such as limits on the joint angles. The proposed contact model extends the scope of Lagrangian and Hamiltonian neural networks by allowing simultaneous learning of contact and system properties. We demonstrate this framework on a series of challenging 2D and 3D physical systems with different coefficients of restitution and friction. The learned dynamics can be used as a differentiable physics simulator for downstream gradient-based optimization tasks, such as planning and control.

Extending Lagrangian and Hamiltonian Neural Networks with Differentiable Contact Models
Yaofeng Desmond Zhong', Biswadip Dey Amit Chakrabortyl
SSiemens Technology. Princeton, NJ 08536, USA.
Kyaofeng.zhone riswadip.dey amit. haat.cccarbbboryy@iieeeeeee com
Abstract
The incorporation of appropriate inductive bias plays critical role in learning dynamics from data. growing body of work has been exploring ways to enforce energy conservation in the learned dynamics by encoding Lagrangian or Hamil- tonian dynamics into the neural network architecture. These existing approaches are based on differential equations, which do not allow discontinuity in the states and thereby limit the class of systems one can learn. However, in reality, most physical systems, such as legged robots and robotic manipulators, involve contacts and collisions, which introduce discontinuities introduce a differentiable contact model, which can capture contact mechanies: frictionles/frrctiional, as well as clastic/inelastic. This model can also accommo- date inequality constraints, such limits the joint angles. The proposed contact model extends the scope of Lagrangian and Hamiltonian neural networks by allow- ing simultancous learning of contact and system properties. We demonstrate this framework on a series of challenging 2D and 3D physical systems with different coefficients of restitution and friction. The learned dynamics can be used differentiable physics simulator for downstream gradient-bare baaden optimization tasks, such as planning and control.
the states. this paper, we
Introduction
large class of real-world physical systems evolves a piecewise-continuuus manner. For example, while playing tennis, tennis balls collide with the ground and the rackets with high elasticity but follow smooth trajectories governed in between those collisions. The ability to walk/run depends heavily on the contacts between the legs and the ground. Unfavorable contact properties can significantly hinder this ability; for example, lack of friction makes it very difficult to walk on icy roads. Robotic manipulators and grippers also rely on contacts and collisions to perform their assigned tasks. These examples highlight the importance of contacts and collisions, which can be found everywhere.
Encoding energy conservation into the computation graph of neural network constitutes effective way to improve its data-efficiency and generalization performance in inferring the dynamics of a physical system from its trajectory data []] However, these energy mergy-conserrvng models assume the system trajectories to be smooth and governed by ordinary differential equations (ODE), they cannot model dynamics with contacts and collisions. On the other hand, another line of work, for example, interaction network (2). neural physics engine [3, and iterative neural projection 44] can model collisions and contacts and learn the associated properties. However, they are not ODE-based and hence cannot infer the continuous dynamics governing the smooth portion of the trajectories. A more recent work [5] has encoded discrete form of the Euler-Lagrange equation while learning
'Code available htt.aat...tttt.g.......o...o.sss
Video available at
35th Conference on Neural Information Processing Systems (NcurIPS 2021).

---

properties of frictionless 2D contacts. Learning of properties associated with frictional contacts and 3D contacts still remains a relatively underexplored topic in the literature.
In this work, we introduce a contact model that can handle frictional contacts both with or without elasticity as well as enforces meegy-coonservation during the smooth portions of the trajectories. The scope of mnergy-conserving neural networks are extended by the contact model. The contact model solves convex optimization problems calculate the jump in velocity during contact. In order to use this contact model in deep learning tasks, we build upon the recent progress on differentiating through convex optimization problems [ We demonstrate the performance of the differentiable contact model in learning coefficients of restitution and friction associated with variety of 2D and 3D contacts. In addition, we also demonstrate the framework as differentiable physics simulator and test it in downstream planning tasks.
1.1 Related Work
Neural Networks: In the last few years, an increasing volume of work has proposed neural network models to learn the underlying dynamics from data while enforcing energy conservation. This line of works leverage Lagrangian dynamics (-12) or Hamilto- nian dynamics [3416] to incorporate the physics prior of energy conservation into deep learning. Recently, Finzi et al. [17] show that using Cartesian coordinates and enforcing explicit constraints improve learning in both Lagrangian and Hamiltonian settings. To learn the underlying dynamics governed by an ODE, many of these prior works have used Neural ODE [8] which can learn an ODE from observed trajectories. However, real systems often exhibit non- non-smooth trajectories caused by sudden/abrupt changes in the velocity due to contacts and collisions. Although Neural ODE based approaches have recently been extended for learning dynamics with jump discontinuities [1 they cannot accommodate the physical constraints (e.g., maximum dissipation principle, neural networks,
non-negative normal force) associated with contacts. Among the
only [16] attempted to address contacts and collisions; to capture the elastic collision of a billiard ball, it manually reverses the momentum of the ball orthogonal to the contact surface. However, this specialized technique cannot be applied to frictional or inelastic contacts, or objects that can rotate.
Our contact model shares similarity with the contact model of MuJoCo [22 24). However, there are three differences: (1) our contact model handles clastic contacts while MuJoCo only focuses on inelastic contacts; (2) MuJoCo solves the convex optimization problem with generalization of the Projected Fauss-Seidel method while we leverage the open-source scs solver 25 to solve the optimization problem; (3) the dynamics in MuJoCo is described using generalized coordinates, while we use Cartesian coordinates, since it has been shown in previous work [17], the use of Cartesian coordinates improves the learning of system properties. Another category of contact models solve contact impulses by solving a linear complementarity problem (LCP) 26) Recently, a number of works (27/32) has proposed differentiable LCPs for downstream planning and control tasks. However, their performance on learning the contact properties has yet to be tested.
Contact Model:
Differentiable Simulation: The recent past has also witnessed a growing interest in differentiable physics simulation that can be used in many downstream tasks (e.g.. parameter estimation, planning, LCP formulation to learn contact impulses for perfectly inelastic contacts. DiffTaichi [35 focuses on material point method and only provides intuitively simple contact mechanisms. The support for partially elastic frictional contacts is yet to be provided. Geilinger et al. (36) differentiates through the dynamics solver analytically. Macklin et al. (37 develop compliant contact model and formulate an implicit time-stepping scheme for integrating the dynamics. Incremental Potential Contact (IPC) 40 uses a custom implicitly time-stepped solver to solve nonlinear intersection- -fee and inversion- free elastodynamies. However, it is not clear if unknown dynamics and contact properties can be learned using the implicit time-stepping scheme proposed in [37 40 NeuralSim [38] formulates a nonlinear complementarity problem learn contact impulses and then solves it using Projected Gauss-
and control) B3 38). Jiang et al. [39]
GradSim [41] uses a relaxed Coulomb model to learn contacts from video sequences. Le Lidec al. [42) propose a differentiable physics simulator that can handle conic friction and elasticity. They demonstrate its ability for system identification on a simple 2D system. Chen et al. 43 propose neural event functions to handle instantaneous changes in a continuous system and test it on frictionless bouncing balls. However, these prior differentiable simulation models do not focus on the energy aspect of the system and their performance on the prediction of system energy (of learned dynamics) has not been evaluated.

---

1.2 Contribution
The main contribution of this work is three-fold. First, by introducing a differentiable contact model, we extend the scope of Lagrangian/ Lagrangian/Hamilonian Hamiltonian iampteniin-inspiree deep learning methods from collision- free systems to more realistic systems with contact and collisions. Second, we demonstrate the simultaneous learning of system and contact properties in variety of physical systems by integrating the contact model with Constrained Lagrangian/Hanitoniaa neural networks (CLNN/CHNN), We show that the learned contact properties, i.e., coefficients of restitution and friction, are interpretable and match the ground truth with high accuracy. Finally, the learned contact model with CLNN/CHNN can be used to solve downstream gradient-based optimization tasks.
2 Preliminaries
2.1 Rigid body dynamics without contacts
Consider a rigid body system whose configuration at time is described by a set of coordinates x(t) := (x1 (t), xz()),.... (p.)),,...()).))) (t)).. Then the time evolution of this system can be expressed as the following second-order ODE,
X = hxx X; P:),,
(1)
where P. denote system properties, which may include inertia of objects M(x) and potential energy V(x). The vector valued function h can be derived from the laws of physics, e.g. Lagrangian/Hamil tonian dynamics. By introducing := xx Eqn. (I) can be written as the following first-order ODE
h(x, v...) gg(x, P.).
There are two popular choices for the coordinates x the generalized coordinates and the Cartesian coordinates. The generalized coordinates are usually chosen as a set of independent coordinates which implicitly enforces holonomic constraints (equality constraints, see Appendix for details) in the system. The Cartesian coordinates are in general not independent of each other, so that the holonomic constraints in the system must be enforced explicitly in the dynamics ( Although g is usually derived with generalized coordinates, this work uses Cartesian coordinates and explicit constraints [17] to demonstrate the results. The proposed contact model is independent of the choice of coordinates and g. We provide the expression of g used in this work in Appendix B.
2.2 Rigid body dynamics with contacts
In robotics tasks, the above assumption of no collision and contact no longer holds. For ex- ample, legged robots move around through re- peated collisions/contacss between the robot legs and the ground, and robot arms grasp ob- jects by making frictional contact with them. The difficulty of modeling these phenomena is that they essentially make the dynamics dis- continuous. For example, when ball hits the ground, its velocity changes from pointing downward to pointing upward in an infinites- imally small period of time, which can be modeled as an instantancous change in veloc- ity Av. In general, contacts, collisions, and joint limits can all be modeled in this way. Algorithm|] I shows the general procedure of modeling rigid body with contacts, where a jump in velocity is calculated by contact model whenever there exist active contacts.
Algorithm 1: Rigid Body Dynamics with Contact
Input:
te, t1,.... .....y (Xo, vo)
Sequence of time points
Initial condition at to
P. = (M(x), Vx)))
System properties
P. (p.ep)
Contact properties
g(x, v.P.)
First-order system dynamics
Initialize output trajectories T = { {Xx,, vo)}. for 0 -
(x++1) ODESolVe(g, vi), t,, fx+1)
Get active contacts c, (collision detection) if exist active contacts then
Av +
ContactModel (x41, CaPP.c.
Vi-i +- Vi+i + Av
T T
From simulation perspective, with known system properties, contact properties (coefficients of friction and restitution), and vector field g. the trajectory of the system can be simulated by Algo- rithm I From a learning perspective, we frame the problem learning unknown system and contact
3

---

properties from a given set of trajectories given a model prior of vector field In this case, we can parametrize the unknown system and contact properties (ps. Pt.) by neural networks and learnable parameters, predict trajectories by Algorithm [ and minimize the difference between the predicted and actual trajectories by backpropagation. This training scheme requires all operations in the forward pass (Algorithm I to be differentiable. There are two key parts in the forward pass the ODE solver module and the contact model. Operations in the ODE solver are in general differentiable, and Neural ODE [18] 44) provides a framework of backpropagating through ODE solvers with constant memory cost. In this work, we provide a differentiable contact model so that we can extend these previous works to learn rigid body dynamics with contacts.
3 A differentiable contact model
In this section, we introduce a differentiable contact model for learning rigid body dynamics with contacts. The proposed contact model solves post-contact velocities by solving contact impulses in two phases [45] a compression phase, starting from the first contact of objects till the maximum compression, and restitution phase, starting right after the compression phase till the separation of objects. We start by presenting the constraints imposed by frictional contacts.
3.1 Contact constraints
This work focuses types of contact frictional contact and limit constraint. For any conceptual frictional contact in a 3D contact space, the contact impulse f, E R3 must lie in the friction cone,
pefi.n Ren Pirg Vi,
where μn 2 0 is the coefficient of friction for conceptual contact i. In addition, the normal impulses must be non-negative, since objects can only push but not pull others:
fin 2 0, Vi.
(4)
For any limit constraint such as limit in joint angle or distance, the contact space essentially one dimensional and the constraints on contact impulses are only fin 2 This mathematically equivalent to setting up a 3D contact space like that in frictional contact and letting = 0 in Eqn.
3.2 Contact model in compression phase
The idea behind solving contact impulses during the compression phase is the maximum dissipation principle [46], which states that the compression impulses should maximize the rate of energy dissipation. Equivalently, the compression impulses end of the compression phase. This can be described by an optimization problem [4] 46 22 23 We
those that minimizes the kinetic energy at the
choose the following form, which is similar to the one used in Mujoco (2]24
Minimize f
(FE)TAfE + (TE)TVC
(5)
subject to
where fü denotes the impulses in compression phase, A is the inverse inertia in the contact space, and ve represents the velocity in the contact space before the compression phase. This formulation is an approximation the Signorini condition, please see [4] 24 for more details. A concise derivation
of (5) from the first principle is provided in Appendix C.
3.3 Contact model in restitution phase
Similarly, we
up optimization problem to solve for the contact impulses in the restitution phase Ez. We assume the restitution follows Poisson's 's hypothesis, where the normal components in fr equals those in fg scaled by the coefficient of restitution ep. We adopt Poisson's 's hypothesis
instead of the popular Newton's 's hypothesis used in prior works 2
27 35 16], because the latter
might result in unrealistic energy increase in certain systems discussion. We set up the following constraint:
48 Please see Appendix D for
f 2 Ep,i fi Vi.
(6)

---

We have inequality instead of equality here since we would like to compensate for existing penetration in the simulation. Since we simulate the rigid body system in discrete time steps, almost every time when a collision is detected, penetration has already occurred among the objects involved in that collision. Consider the case where the collision perfectly inelastic, i.e., COR ep = O, then the true normal impulse during restitution phase would be zero, which fails to fix existing unrealistic penetration. By setting up the constraint as in Eqn. (6) larger normal impulse is allowed to fix existing penetration. The optimization problem in the restitution phase is
Minimize fCz (E (vE) vv)
subject to
with ve* as the velocity in contact space after the compression phase and vO as the target velocity, used for fixing penetration. If there's no penetration, V 0. A detailed discussion of penetration compensation can be found in Appendix G. From the principle maximum dissipation, the equality in Eqn. (6) would hold for the solution when COR large and penetration small, thus respecting Poisson's ss hypothesis when penetration can be fixed naturally.
3.4 Differentiability
Solving optimization problems 5 and (7) for contact impulses allow us to calculate instantaneous velocity change to perform simulation (Algorithm D]. Moreover, we would like to back-propage prokppppe through the contact model to learn unknown propertics. fact, our proposed contact model is differentiable, thanks to recent progress differentiable convex optimization layers. Both problems (5) and 7 are convex optimization problems with convex quadratic objectives (we show that A is positive semi-definite in Appendix E) well as linear constraints and second-order cone constraints. We can then express our problems using disciplined parametrized programming (DPP) and set up these two problems differentiable layers using CvxpyLayers (6]. Thus, model is differentiable and can be used in dynamics and parameter learning as well as downstream tasks.
Experiments: dynamics and parameter learning
4.1 Simulated systems
To evaluate the proposed contact model, we simulate five different systems with contacts (Fig. [ and propose eight dynamics and parameter learning tasks based on these systems with different contact properties (Table []. Previous work has studied the bouncing point masses (Fig. ((a)) which is often referred to as billiards or bouncing balls [16 27 33). To make this task more challenging, we let the size of each object be different. We also propose the bouncing disks (Fig. [Tb)p where each disk can rotate. The 2-pendulum colliding with the ground has been used to study and analyze contact models more than three decades [49]. We make this task more challenging by studying a 3-Pendulum colliding with the ground (Fig. [(c) The gyroscope is 3D system that exhibits complex dynamics. gyroscope colliding with a wall (Fig. [(d) is a system where the normal contact impulse does not point towards the center of mass (c.o.m). and Newton's 's hypothesis might give unrealistic result with increased energy after collisions [48]. The rope (Fig. [(c) has also been studied in previous
works 2 4. Please refer to Appendix H for further details about these systems and the tasks.
(a)
(b)
(c)
(d)
(c)
Figure 1: Simulated systems with contact. From left to right: (a) bouncing point masses, (b) bouncing disks, (c) chained pendulums with ground, (d) gyroscope with wall, and (e) rope. The black lines in bouncing disks show the orientations of disks.
5

---

Table 1: Benchmark tasks. The columns D, E, max(C) denote dimension of the dynamics, number of equality constraints, and the maximum number of contacts that could be simultaneously active, respectively.
Same ep, for contacts
Conserve energy
Name
System
D
E
max(C)
Space
BP5-e
Bouncing point
10
0
8
2D
Y
Y
BP5
Bouncing point masses
2D
N
CP3-c
Chained pendulums w/ ground
3
1
2D
Y
Y
CP3
Chained pendulums w/ ground
3
1
2D
Y
N
BD5
Bouncing disks
30
15
8
2D
N
N
Rope
Rope
400
399
2D
Y
N
Gyro-e
Gyroscope w/ a wall
Y
Y
Gyro
Gyroscope w/ a wall
12
7
1
3D
Y
N
4.2 Dynamics and parameter learning experimental setup
For each simulated system, we jointly learn system and contact properties from trajectory data by extending CLNN/CHNN with the proposed contact model. Fig. shows the architecture.
Data: For each task, the training is generated by randomly sampling 800 collision-fiee initial conditions and then simulating the dynamics for 100 time steps. Since for some systems, there are very few data points in trajectory that involves collision, select small chunk containing consecutive time steps from each simulated trajectory such that the final training set contains 800 trajectories of length 5, where around half of the trajectories contain collisions and the other half collision-free. We also make sure that the initial state of these selected chunks collision-free. The evaluation and test set are generated in similar way with 100 trajectories, respectively.
Architecture and training details: the experiments, we assume the system properties, i.c., object inertia and potential energy, well as contact properties, i.e., coefficients of friction and restitution, are unknown and need to be learned from trajectory data. The system properties are parametrized in CLNN and CHNN [17]. As for contact properties, all coefficient of friction non-negative, so they are parametrized by scalar learnable parameters passed through ReLu function. As each coefficient of restitution lies in the interval of [0, 1). it is parametrized by learnable parameter passed through a hard sigmoid function. The predicted trajectories are generated by running Algorithm with parametrized system and contact properties. We RK4 the ODE solver in Neural ODE. We compute the L1 -orm of the difference between predicted and true trajectories, and use it as the loss function for training. The gradients are computed by differentiating through Algorithm [ and learnable parameters are updated using the Adam W optimizer [50 with a learning rate of 0.001.
Models: We implement two slightly different versions of the contact model. The first version, referred to as CM, set up optimization problems exactly as stated in (5) and (7). The second version, referred to CMr, adds diagonal positive regularization matrix R el to A in (5) and (7), such
(xo, vo).
ODESolve(CLNN)
(*, v) g(x, M. (x), VA, (x))
(x), v1)
(x) V1
ContactModel
(x).
ContactModel CM
ODESalve(CLNN)
ContactModel (x, v;Ma (x), .pl
(xe, v2)
(x)g v2)
(82
v' Av
ODESolv3iCLND
Loss
(Xr, Vr MXr, v
ContactModel
(KT,
L=
+||, v.ll.)
Figure 2: Dynamics and parameter learning schema of the CM-CD-CLNN model. Neural networks red. Predicted trajectories are generated using parametrized CM and CLNN. The difference between the true and predicted trajectories are minimized learn dynamics and parameters.
and learnable parameters are denoted in

---

that (A + R. is always positive definite, which ensures a unique global minimum in each problem These two versions are combined with CLNN and CHNN set up the following four neural network models: (i) CM-CI-CINNN, (ii) DMNCCD-CHNN, (iii) CMr-CI-CLNN, and (iv) CMr-CD-CHNN, The "CD" model names emphasizes that we assume that a collision detection module given.
Baselines: We also set up three baselines. In the first baseline, MLP-CD-CLNN, we calculate the instantaneous velocity change from multi-layer perceptron (MLP) instead of the proposed contact model. Our second baseline, IN-CP-CLNN, calculates velocity change from an interaction network (IN) without requiring a collision detection module, since IN has the ability to learn collisions and contact. IN requires system and contact properties as input. Here the "CP" in the model name emphasizes true contact properties are given and the system properties learned by CLNN are fed into IN. Our last baseline, IN-CP-SP: SP, is the original interaction network which has shown strong ability in predicting 2D rigid body trajectories without equality constraints, but haven't 't been tested on systems with equality constraints or 3D systems. The name emphasizes that true system and contact properties are known and are fed into IN. Also, the name indicates no collision detection module is needed in this baseline. To train these baseline models, we transform each trajectory into multiple one-step pairs, as has been done in IN (2). We also attempted to use the LCP formulation of contact model 27 as baseline. However, the implementation of gradient computation of the LCP function in 27 results in NaN in our examples. Please refer to Appendix for additional details. As the forward computation of LCP works as expected, we use LCP- -eneereedd training data to test the robustness of our model.
4.3 Dynamics and parameter learning results
Our implementation relies publicly available codebases including Pytorch [52], CHNN [7] Symplectic ODE-Net [14] and Neural ODE [18]. We handle training using Pytorch Lightning |33 for the purpose of reproducibility.
Prediction: We report the average relative I, error over the test trajectories of 7 models on tasks models beat baseline models. The performance difference between CLNN and CHNN is minor since their architectures are similar. In most tasks, CM outperforms CMr. In the BP5-c task, CM beats CMr by orders of magnitude. IN does not perform well even in BP5 tasks since our training set (3.2k one-step pairs) is much smaller than the dataset (1M one-step pairs) used in the IN paper. We also report average relative Lı errors along test trajectories of 50 time steps in Fig. 4 in order to show each model's s ability in long term prediction. We observe that our contact models CM and CMr outperform baselines in all tasks.
in Fig. 3 In all tasks,
Interpretable mass ratio: Without direct supervision on mass, deep learning algorithms are unlikely to recover the true mass, as pointed out in [1]. However, one can still inspect the ratio of learned mass values to see how well this physical property is learned. The mass ratio plays an important role in determining the motion of objects when they interact with each other, e.g., during colli- sions. In our BP5 task, CM-CD-CLNN learns the mass ratio [m2/m1, ma/ m. m4 m1, ms/mm = [2.0001, 6. 6.0036, 8.0014, 10.0024], which is very close to the true ratio [2, 6, 8, 10). In fact, our framework is able to accurately learn mass ratios across tasks (please see Appendix for details).
Interpretable contact properties: Table 2 shows the learned contact properties by our 4 models in tasks where the contact properties are the same for contacts. For all tasks, CM can learn contact
'hhe regularization is important for obtaining the inverse dynamics, as stated in 23 However, the unregu- larized one learns more accurate dynamics and contact propertics, shown in Fig. 4 and Table 2
10a
10-1
10-1
10-1
BP5-e
BP5
CP3-e
CP3
BDS
Rope
Gyro-e
Gyro IN-CP-SP(original IN)
CM-CD.CLNN
CM-CD-CHNN
CMI-CD-CLNN
CMr-CD-CHNN
MUP-CD-CLNN
IN-CP-CLNN
Figure 3: Trajectory relative error (log scale) with 95% confidence interval error bars. Each error averaged over 100 test trajectories of length 5.
7

---

Gyro-e
Relative error in states
10"2
10-1
0.2
0.2
0.4
0.2
0.4
BP5
CP3
Rape
Gyro
101
10
10"5
0.0
0.3
0.2
0.3
0.4
0.5
0.0
0.1
0.2
0.3
0.4
055
0.00
0.05
0.10
0.15
0.20
0.25
0.0
0.2
0.4
D.6
0.8
100
Tiime (6)
Time (5)
Time (S)
Timee (6)
CM-CD.CLNY
CM-CD.CHNN
CMM-CD-CLNN
CM-CDD-CHN
MLP-CD CLNN IN-CP.CLNN
IN-CP SPioriini
Figure 4: Relative error (log scale) along long test trajectories (50 times steps). Each curve is averaged over 100 test trajectories. Vertical dashed lines show the trajectory length during training.
Energy along tral.
BP5-0
CP3-c
Gyro-c
0.4
2.2
0.3
-1.7
-18-
0.1
0.1
0.3
0.2
0.4
0.2
0.5
16
(5)
CM
CM-CD-CHNN
CMr-CD CLNNC
CM-CD CHNN
MLP-CD-CLM
IN-CP-CUNN IN-CP-SP
Figure 5: Energy of the predicted trajectories of all 7 models on a sampled test initial condition from BP5-e, CP3-c and Gyro-e tasks. The true energy in each task is represented by the horizontal black line in the middle, which is constant along the trajecotry.
properties accurately which explains its good performance in prediction. CMr is an approximate model and does not infer contact properties as accurately as CM. The interpretability of the learned contact properties along with the mass ratio explains the performance of our framework and shows that the proposed contact model indeed extends Lagrangian and Hamiltonian neural networks.
The prior of Lagrangian/Hamiilonian dynamics conserve energy along each collision free trajectory, which one of the reason that Lagrangian/ Haaiiiiaaaaammiiiin--biiiiii perform better in prediction and generalization 77 14 10.. Fig. 5 Jillustrates how the total energy changes over time for the predicted trajectories of models on tasks that conserve energy since the contacts are elastic and frictionless (i.e., ep = 1, 0). Models using CM perform the best in conserving energy in all three tasks since CM learns contact properties perfectly (Table (2). This demonstrates that the proposed contact model can uncover the energy conserving aspect even though energy conservation has been enforced explicitly. For CP3-e and Gyro-e systems, models using CMr lose energy each time collision happens since they learn positive coefficients of friction in these tasks (Table 2). The baseline models perform the worst terms of energy conservation.
Energy:
neural network models
Sample efficiency: We use the BP5 task to demonstrate the sample efficiency of this proposed framework. We vary the training sample size from 25 to 800 trajectories and report the validation loss (L, (norm) of CM-CD-CC CLNN, LLP-CD-CLNN, and Interaction Network. Figure shows that our framework works well even with limited training data.
Table 2: Learned contact properties from our 4 models on tasks that has unique contact properties for all contacts. Bold numbers the best learned contact properties in each task across models.
BP5-e
CP3-c
CP3
Rope
Gyro-e
Gyro
μ
ep
ep
ep
eP
μ
ep
ep
Ground Truth
0.000
1.000
0.000
1.000
0.500
0.000
0.000
0.000
0.000
1.000
0.100
0.800
CM-CD-CLNN
0.000
1.000
0.000
1.000
0.500
0.005
0.026
0.000
0.000
1.000
0.100
0.800
CM-CD-CHIP
0.000
1.000
0.000
1.000
0.500
0.004
0.017
0.000
0.000
1.000
0.100
0.800
CMr-CD-CLA CLNN
0.000
1.000
0.002
1.000
0.500
0.023
0.037
0.011
0.002
1.000
0.099
0.892
OMr-CD-CHNN
0.000
1.000
0.002
1.000
0.500
0.023
0.046
0.019
0.002
1.000
0.099
0.893

---

Scalability: In Table we report the average wall clock time in each iteration (forward pass and backward pass) during training of three sizes of ropes. The time scales approximately linearly with the numbers of coordinates (D) and contacts (C). See Appendix L. for additional results for scalability.
101
101
Number of training trajectories
We evaluate the robustness of our framework by training our model using data generated by LCP formulation and noisy data. (See Appendix for details.) When trained on LCP data, our framework can learn accurate contact properties in 2D tasks. For the 3D Gyro tasks, the learned contact prop- erties are not as accurate (e.g., learned COR of 0.822 instead of 0.800). This is expected since the I.P formulation relaxes the 3D friction cone into (linear) polyhedral cone and the direction of friction impulses would deviate from those given by our contact model, which is based on the second-order fric-- tion cone. addition, we observe that the performance of our model does not suffer from noisy data since we incorporate strong physics prior into deep learning. For CMr, we also perform an ablation test to investigate the influence of the amount of regularization. By setting the regularizer R = cI, observe that smaller e (c.g. 0.001) result in more accurate learned contact properties. This is expected since a smaller approximate (5) and 7 better. However, making learnable parameter does not improve accuracy. Please see Appendix K for more details.
Robustness:
Figure 6: Validation losses for the BP5 task.
Table 3: Average wall clock time in each iteration of ropes. The last column shows increases in time
D
max(C)
time (8)
100
99
0,869
200
~ 199
1,563
1.7x
400
~ 399
3.225
3.7x
Experiments: downstream tasks
Since our framework is differentiable, we can use it as a differentiable physics simulator to solve downstream tasks after have learned the system and contact properties. Here we demonstrate this capability by considering three gradient- -based trajectory planning tasks and using CM-CD-CLNN.
Billiards: We study the same billiard task as in DiffTaichi 35 The goal is to find the initial position and velocity of the white ball such that blue ball hit the black target at the 1024th time step. In order to test framework's 's ability to solve downstream task and make comparison with DiffTaichi, we assume the parameters such as mass and contact properties are known, the same assumption in DiffTaichi. Fig ((a) and 7(b) shows the solution found by our proposed model and DifiTaichi, respectively. This task does not have a unique solution since one can place the white ball closer to the billiards with relatively small initial velocity (e.g. DiffTaichi solution) or place the ball farther away from the billiards with a relatively large initial velocity (c.g. our solution). Fig (c) compares the convergence, where the loss is the distance between the black target and the blue ball at the 1024th time step. DiffTaichi has better convergence probably because it implements a simpler contact and dynamics model and it takes time of impact (TOI) into account. The TOI might be able to explain why the optimized positions of the white balls DifhTaichi and our method are on the right and left of the initial guess, respectively the gradient w.r.t. the initial position using naive integrator and TOI have different signs (Figure in 335
We present two throwing tasks as shown in Fig. g These throwing tasks are simpli- fied versions of similar tasks studied in [36 37). but we solve the tasks based on learned dynam- ics while previous works [36] 37] solve them with true dynamics. In the "hit" task (Fig. ((a)
Throwing:
0.4
CM-CD-CLAN
0.02 1g
Difrbichi
100
Iteration
(c) Figure 7: Billiards. (a). (b): The solid white ball and arrow shows the initial position and velocity optimized by AM-CDDCLNN and DiffTaichi, respectively, while dashed white ball and arrow shows those of the white ball before optimization. (c): Loss as function of training iterations.
(b)

---

the initial position of the disk is fixed, the goal is to find desired initial velocity so that the disk reach the target (black circle) after exactly one bounce off the ground. In the "vertical" task (Fig. [ the initial position and the translational velocity are fixed, so that first half of the center of mass (c.o.m) trajectory (dashed blue) is fixed. The goal is to find a desired initial angular velocity such that the second half of the c.o.m trajectory as close to a vertical line (dashed black) as possible. this task need to learn counter-clockwise spin such that when the disk bounces off the ground, there are enough friction to stop the horizontal motion.
(a)
(b)
Figure 8: Blue hollow circles indi- cate the initial position of the disk. (a) the "hit" task. The black hollow circle indicate the target position. (b) the "vertical" task.
For these two tasks, we parametrize the initial condition to be learned, simulate the trajectory based on the learned system and contact properties, and minimize the difference between simulated outcome and the goal by gradient descent. We can successfully find the initial conditions to achieve the tasks, evaluated using the true system and contact properties. (Please see the video for additional details).
6 Conclusion
In this work, we have introduced a differentiable contact model, which can capture contact dynamics with different properties. Our contact model extends the applicability of Lagrangian/Hamiltniaa inspired neural networks to enable the learning of hybrid dynamics in rigid body systems and offer interpretability about system and contact properties. We show that the proposed framework achieves better prediction with fewer samples and is robust against noisy data or LCP-generated data. Future works will incorporate model-based control and explore interpretable safe control policies for robotics applications. A particular direction could be to develop appropriate energy shaping control policies (54) and integrate them with this proposed learning framework.
Limitations: Our framework assumes a known collision detection module. Although it can be obtained from an idealized touch feedback sensor [5], this information might be unavailable in other scenarios. Future work would explore how to relax this assumption. Our framework might fail to correctly simulate systems which have extremely high mass ratios stiffness ratios compared to Macklin et al. (37]. where they show their primal method and dual method perform well in high mass ratios and high stiffness ratios scenarios, respectively. Our model might also have challenges in contact-rich systems and might not be as scalable as IPC [40]. Please see Appendix I. for additional scalability results. Our framework also uses a mix of acceleration-basee simulation (integrating continuous dynamics) and time-stepping methods (calculating instantaneous velocity change) while other simulation methods typically use only one of them. This is because we'd 'e'd like use RK4 to better enforce the conservation of energy as done in [14, 17). However, this choice also makes our simulator not as efficient as other simulators. We would like to compare our method other differentiable physics model such as NeuralSim (38] and gradSim
[41.. However, gradSim has not been open sourced when this work is conducted and is hard to reproduce model. NeuralSim has its own automatic differentiation engine where gradient are computed one at the time, which suitable for downstream tasks as demonstrated in [38]; however, it is not suitable for dynamics and parameter learning tasks where large number of parameters need to be updated based on their gradients. Additional efforts need to made to incorporate NeuralSim with deep lcarning frameworks. Although
not able to compare difficulties demonstrate that dynamics and parameter learning with differentiable physics simulators are currently underexplored in the literature.
work with these differentiable physics simulators, these
We introduce a framework for data-driven dynamics modelling which uses physics- based priors to improve generalization, sample efficiency, and interpretability. Data-driven dynamics modelling, in general, can have a profound effect learning-based control synthesis, especially in robotics and automation. However, our proposed framework is still a conceptual proposal and has a very low (around 2) Technology Readiness Level (TRI.) (55). We are yet to fully understand its limitations and failure scenarios that can significantly influence its rerl-world adoption.
Societal impact:
10

---

Acknowledgments and Disclosure of Funding
The authors would like to thank Siemens Technology for supporting this work. Funding in direct support of this work are from Siemens Technology. There are no competing interests.
References
[1] Yaofeng Desmond Zhong, Biswadip Dey, and Amit Chakraborty. Benchmarking Energy- Correy--onseriinggg Neural Networks for Learning Dynamics from Data. arXiv preprint MxXiv:2012.023344 2020.
[2] Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, and Koray Kavukcuoglu. Inter- action Networks for Learning about Objects, Relations and Physics. In Advances in Neural Information Processing Systems, volume 29, pages 4502-45 4510, 2016.
[3] Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua Tenenbaum. A compositional object- based approach to learning physical dynamies. In International Conference on Learning Representations, 2017.
[4] Shuqi Yang. Xingzhe He, and Bo Zhu. Learning physical constraints with neural projections. In Advances in Neural Information Processing Systems, volume 33, 2020.
[5] Andreas Hochlehnert, Alexander Terenin, Steindor Saemundsson, and Mare Deisenroth, Learning Contact Dynamics using Physically Structured Neural Networks. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130, pages 2152 2160, 2021.
[6] Akshay Agrawal, Brandon Amos, Shane Barratt, Stephen Boyd, Steven Diamond, and J. Zico Kolter. Differentiable Convex Optimization Layers. In Advances in Neural Information Processing Systems, volume 32, pages 9562-9574, 2019.
[7] Michael Lutter, Christian Ritter, and Jan Peters. Deep Lagrangian Networks: Using Physics as Model Prior for Deep Learning. In International Conference on Learning Representations, 2019.
[8] Michael Lutter, Kim Listmann, and Jan Peters. Deep Lagrangian Networks for end-to-end learning of energy-based based control for under-actuated systems. In 2019 JEEE/RSJ International Conference on Intelligent
Robots and Systems (IROS), pages 7718-7725, 2019.
[9] Manuel A. Rochrl, Thomas A. Runkler, Veronika Brandtstetter, Michel Tokic, and Stefan Obermayer. Modeling System Dynamics with Physics-Informed Neural Networks Based on Lagrangian Mechanics. In 2 st IFAC World Congress, 2020.
[10] Miles Cranmer, Sam Greydanus. Stephan Hoyer, Peter Battaglia, David Spergel, and Shirley Ho. La- grangian neural networks. In ICLR 2020 Workshop on Integration of Deep Neural Models and Differential Equations, 2020.
[11] Yaofeng Desmond Zhong and Naomi Leonard. Unsupervised Learning of Lagrangian Dynamics from Images for Prediction and Control. volume 33, 2020.
[12] Christine Allen-Blas -lanhllne Sushant Veer, Anirudha Majumdar, and Naomi Ehrich Leonard, LagNetViP: A Lagrangian Neural Network for Vidco Prediction. arXiv preprint arXiv:2010. /2932, 2020.
[13] Samuel Greydanus. Misko Dzamba, and Jason Yosinski. Hamiltonian neural networks. In Advances in Neural Information Processing Systems, volume 32, pages 15379-15389) 2019.
[14] Yaofeng Desmond Zhong, Biswadip Dey, and Amit Chakraborty. Symplectic ODE-Net: Learning Hamiltonian Dynamics with Control. In International Conference on Learning Representations, 2020.
[15] Yaofeng Desmond Zhong, Biswadip Dey, and Amit Chakraborty. Dissipative SymODEN: Encoding Hamiltonian Dynamies with Dissipation and Control into Deep Learning. In ICLR 2020 Workshop on Integration of Deep Neural Models and Differential Equations, 2020.
[16] Zhengdao Chen, Jianyu Zhang, Martin Arjovsky, and Léon Bottou. Symplectic Recurrent Neural Networks.
In International Conference on Learning Representations, 2020.
[17] Mare Finzi, Ke Alexander Wang, and Andrew Gordon Wilson. Simplifying Hamiltonian and Lagrangian Neural Networks via Explicit Constraints. volume 33, 2020.
[18] Ricky TQ Chen. Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. In Advances in Neural Information Processing Syxtems, volume 31, pages 6571-6583, 2018. [19] Junteng Jia and Austin R Benson. Neural Jump Stochastic Differential Equations. Advances Neural Information Processing Systems, volume 32, pages 9847-9858, 2019.
[20] Daehoon Gwak, Gyuhyeon Sim, Michael Poli, Stefano Massaroli, Jaegul Choo, and Edward Choi. Neural ordinary differential equations for intervention modeling. arXiv preprint arXiv:2010.08300 2020.
[21] Calypso Herrera, Florian Krach, and Josef Teichmann. Neural Jump Ordinary Differential Equations. In International Conference on Leurning Representations, 2021.
[22] Emanuel Todorov. A convex, smooth and invertible contact model for trajectory optimization. In 2011
IEEE International Conference Robotics and Automation, pages 1071-1076, 2011.
11

---

[23] Emanuel Todorov. Convex and analytically-invetiie dynamics with contacts and constraints: Theory and implementation in MuJoCo. In 2014 IEEE International Conference on Robotics and Automation (ICRA). pages 6054-6061, 2014.
[24] Emanuel Todorov. Tom Erez, and Yuval Tassa. Mujoco: physics engine for model-based control. In 2012 JEEE/RSJ International Conference on Intelligent Robots and Systems, pages 5026-5033. IEEE, 2012.
[25] Brendan O'donoghue. Eric Chu, Neal Parikh, and Stephen Boyd. Conic optimization via operator splitting and homogeneous self-dual embedding. Journal of Optimization Theory and Applications, 169(3):1042 1068, 2016.
[26] Mihai Anitescu and Florian A Potra. Formulating dynamic multi-rigid-boaa contact problems with friction as solvable linear complementarity problems, Nonlinear Dynamics, 14(3):231-247, 1997.
[27] Filipe Avila Belbute-Peres, Kevin Smith, Kelsey Allen. Joshua B Tenenbaum, and Zico Kolter. End-to- end differentiable physics for learning and control. In Advances in neural information processing systems, volume 31, pages 7178-7189, 2018.
[28] Jonas Degrave, Michiel Hermans. Joni Dambre, and Francis Wyffels. A differentiable physics engine for deep learning in robotics. Frontiers in Neurorobotics, 13:6, 2019.
[29] Junbang Liang and Ming C. Lin. Differentiable Physics Simulation. In ICLR 2020 Workshop on Integration
of Deep Neural Models and Differential Equations, 2020.
[30] Changkyu Song and Abdeslam Boularias. Identifying mechanical models of unknown objects with differentiable physics simulations. In Proceedings of the 2nd Conference on Learning for Dynamics and
Control, volume 120 of Proceedings of Machine Learning Research, pages 749-760. PMLR, 2020.
[31] Changkyu Song and Abdeslam Boularias. Learning to slide unknown objects with differentiable physics simulations. In Robotics science and systems, 2020.
[32] Keenon Werling, Dalton Omens, Jeongseok Lee, loannis Exarchos, and C Karen Liu. Fast and feature- complete differentiable physics for articulated rigid bodies with contact. arXiv preprint arXiv:2103.16021 2021.
[33] Zhenjia Xu, Jiajun Wu, Andy Zeng, Joshua B Tenenbaum, and Shuran Song. DensePhysNet: Learn ing Dense Physical Object Representations via Multi-step Dynamic Interactions. arXiv preprint orXiv:1906.038:0 2019.
[34] Alvaro Gonzalzz, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovee, and Peter Battaglia. Learning to simulate complex physics with graph networks. In International Conference on Machine Learning, pages 8459-8468, 2020.
[35] Yuanming Hu, Luke Anderson. Tzu-Mao Li, Qi Sun, Nathan Carr, Jonathan Ragan- Kelley, and Fredo Durand. DiffTaichi: Differentiable Programming for Physical Simulation. In International Conference on Learning Reprexentations (ICLR), 2020.
[36] Moritz Geilinger, David Hahn, Jonas Zehnder, Moritz Bücher, Bernhard Thomaszewski, and Stelian Coros. ADD: Analytically Differentiable Dynamics for Multi-Body Systems with Frictional Contact. ACM Transactions on Graphics, 39(6). November 2020. ISSN 0730-0301.
[37] M. Macklin, K. Erleben, M. Müller, N. Chentanez. S. Jeschke, and T. Y. Kim. Primal/dual descent methods for dynamies. In Proceedings of the ACM SIGGRAPH/Eunogrpphic Symposiun on Computer Animation, 2020.
[38] Eric Heiden, David Millard, Erwin Coumans, Yizhou Sheng, and Gaurav S. Sukhatme. NeuralSim: Augmenting Differentiable Simulators with Neural Networks. In IEEE International Conference on Robotics and Automation (ICRA), 2021.
[39] Yifeng Jiang. Jiazheng Sun, and C. Karen Liu. Data-Augmented Contact Model for Rigid Body Simulation. arXiv Preprint. 1803.04015 2018
[40] Minchen Li. Zachary Ferguson, Teseo Schneider, Timothy Langlois, Denis Zorin, Daniele Panozzo, Chenfanfu Jiang, and Danny M Kaufman. Incremental potential contact: Intersection and inversion- free. large- dnge-deformation dynamics. ACM transactions on graphics, 2020.
[41] J. Krishna Murthy, Miles Macklin, Florian Golemo, Vikram Voleti, Linda Petrini, Martin Weiss, Breandan Considine, Jérôme Parent-Lévesquee Kevin Xie, Kenny Erleben, Liam Paull, Florian Shkurti, Derek Nowrouzezahrai, and Sanja Fidler. GradSim: Differentiable simulation for system identification and visuomotor control. In International Conference on Learning Representations (ICLR), 2021.
[42] Quentin Le Lidec, Igor Kalevatykh, Ivan Laptev, Cordelia Schmid, and Justin Carpentier. Differentiable simulation for physical system identification. IEEE Robotics and Automation Letters, 6(2):3413-3420. 2021.
[43] Ricky T. Q. Chen, Brandon Amos, and Maximilian Nickel. Learning neural event functions for ordinary differential equations. In International Conference on Learning Representations, 1021.
[44] Stefano Massaroli, Michael Poli, Jinkyoo Park, Atsushi Yamashita, and Hajime Asama. Dissecting Neural ODEs. In Advances in Neural Information Processing Systems, volume 33, 2020.
12

---

[45]
Siméon D Poisson. Mechanics, vol. i. Trans. HH Harte, Longmun, London, 1817.
[46] David Stewart. Rigid-hody dynamics with friction and impact. SIAM Review, 42(1):3-39, 2000.
[47] Michel Jean. The non-smooth contact dynamics method. Computer methods in applied mechanics and engineering, 177(3-4):235 -577, 1999.
[48] Shlomo Djerassi. Collision with friction; Part A: Newton's hypothesis. Multibody System Dynamics, 21
(1):37, 2009.
[49]
Thomas R Kanc and David A Levinson. Dynamics, Theory and Applications. McGraw Hill, 1985.
[50] Diederik P Kingma and Jimmy Ba. Adam: method for stochastic optimization. arXiv preprint MIXiv1442.66980 2014.
[51] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on
Learning Representations, 2019.
[52] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang. Zachary Vito,, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang. Junjie Bai, and Soumith Chintala. PyTorch: Imperative Style, High-Performance Deep Learning Library. In Advances in Neural Information Processing Systems, volume 32, pages 8024-8035. 2019.
[53] Falcon A. et al. PyTorch Lightning. GitHub. Note:
http://gthtub..oo//// Torchhighmingg/pytoon
lightming. 3, 2019.
[54] Jianping Lin, Nikhil Divekar, Ge Lv, and Robert D. Gregg. Energy shaping control with virtual spring and damper for powered exoskeletons. In 2019 JEEE 58th Conference on Decision and Control (CDC), pages 3039-3045, 2019. doi: 10.1 10.1009/DC4002422009.0 2019..9444,,,
[55] Steven Hirshorn and Sharon Jefferies. Final Report of the NASA Technology Readiness Assessment (TRA) Study Team. 2016.
13


Reviews:
[{"review_id": "fQnCTYCO09n", "reviewer": "Reviewer_Kv95", "summary": "The paper proposes a differentiable contact model for enabling estimation of object and contact properties from observed trajectories and also for computing actions in downstream tasks.", "questions": "", "limitations": "", "rating": 4, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "The paper has some major concerns that are listed below:\n\n1. I am unclear on where the contributions lie in the proposed method. The equations for differentiable contacts in Section 3 seems to be from existing work as cited by the authors.  \n\n2. The paper does not compare to existing differentiable methods such as DiffTaichi for the estimation of parameters experiment. Specifically, Difftaichi is able to go around the non-differentiability at impact by using time of impact (TOI). Is there some limitation in using TOI? How does the method compare to difftaichi in estimating the parameters from trajectories. I think if this cannot be done by difftaichi (using gradient descent on TOI), then it would be a clear contribution that the paper can highlight.\n\n3. The paper is focusing on ensuring energy conservation during contact simulation but does not show applications that can take advantage of this. E.g., in the billiard simulation, difftaichi regresses much faster than the proposed method. \n\nI think the paper needs to have some clear experiments and comparisons to existing differentiable simulation methods (instead of MLP like baselines) to highlight it's contributions. In its current form, the paper doesn't clearly show why the proposed method is better or required compared to existing methods for contact simulation.", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "yes", "review_text": "", "extra_scores": {"needs_ethics_review": "No", "ethics_review_area": "", "time_spent_reviewing": "5"}, "extra_text": {}}, {"review_id": "VU-EjR79jUO", "reviewer": "Reviewer_i24Y", "summary": "This paper introduced differentiable contact models into differentiable energy minimizing dynamics formulations like CLNN/CHNN and extends them to handle problem involving collision and contact. An impulse based formulation is used to learn the system and contact properties over a range of tasks.", "questions": "", "limitations": "", "rating": 6, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Strengths\n+ Differentiating through contact is a long standing problem and worth more exploration in the context of machine learning.\n+ Results demonstrate a decent step up from the state of art in neural dynamics and differentiable simulation literature.\n\nWeaknesses\n- Sec 3 could be grounded with some robot example? Unclear how to extend the theory from 3D points, do you just approximate the robot body with 3D points?\n\n- Approach relies heavily on convex optimization, but most real world problems are non-convex. Where is the assumption reasonable to make and where will this approach fail?\n\n- The impulse formulation is a bit limiting (as it allows one action at the start) from the point of view of robot planning/control that the paper motivates. In practice, it would be more desirable to have the ability to find/execute a sequence of force/torque/velocity based trajectories while accounting for contacts.\n\n- Going beyond dynamics and physical parameter identification, some non planar problem with a 3D robot manipulator focused on the planning/control aspect would add a lot more weight to the experiments. Is there more work to do here on the theoretical side or just a matter of implementation?\n", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "One limitation is discussed, could me more thorough.", "review_text": "", "extra_scores": {"needs_ethics_review": "No", "ethics_review_area": "", "time_spent_reviewing": "3"}, "extra_text": {}}, {"review_id": "S1vljlz8D8", "reviewer": "Reviewer_hJGq", "summary": "This paper designs a differentiable contact model and connects it to Lagrangian and Hamiltonian neural networks, enabling simultaneous learning of the contact and system properties. The authors also conduct comprehensive experiments to demonstrate the accuracy, effectiveness, scalability, and robustness of their method.", "questions": "", "limitations": "", "rating": 6, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Originality: Yes, this is my first time reading a differentiable contact model incorporated into Lagrangian and Hamiltonian neural networks. There have been several differentiable contact models that learn frictional coefficients from data, and the authors have cited them.\n\nQuality:\nThe authors have conducted comprehensive experiments.\n\nClarity:\nThe overall writing is good. I just have some difficulties understanding implementation details. \n1. Is there somewhere I can find the structure of the used CLNN/CHNN? Am I right that ODESolve is parameterized by networks while ContactModel is not an NN? Some overview diagrams might help to understand.\n2. What is the formulation to compute the relative L1 errors? In figure 3, why are the baseline purple curves approximating 10^0 instead of exploding? It will also be better if standard deviations are shown in the figure as shaded areas.\n\nSignificance:\nWhat is the advantage of this method compared to other differentiable physics engines? \n1. Others can also learn contact properties. [36] learns contact parameters using neural networks. [29, 30] further use the learned contact properties to perform real-world robot manipulation. Those papers completed similar tasks as this paper does, if not more. The claim in L74 “However, their performance on learning the contact properties has yet to be tested.” might be reconsidered. \n2. Moreover, L83 claims “However, these prior differentiable simulation models do not focus on the energy aspect of the system and their performance on the prediction of system energy has not been evaluated”. Are there any experiments to support this argument? As far as I can imagine, unlike dynamics learned by neural networks, differentiable physics engines should naturally preserve the energy, if no collision happens, because they explicitly follow the physical laws. And their energy can be computed analytically.\n", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "I did not see any potential negative societal impact of their work. The main limitation of this work from my point of view is its significance, which is described in the last part.", "review_text": "", "extra_scores": {"needs_ethics_review": "No", "ethics_review_area": "", "time_spent_reviewing": "7"}, "extra_text": {}}, {"review_id": "O-FNLbfefOw", "reviewer": "Reviewer_BwHT", "summary": "In this work, the authors propose a framework for learning models for dynamical systems that experience contact events by employing a differentiable contact-dynamics model. In simulation, a number of simple experiments are performed to validate such learned models.", "questions": "", "limitations": "", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "The approach utilizes existing tools (i.e., an existing ODE solver and convex solver SCS) to perform time-stepping with collision detection and restitution in forward simulation. The approach is made differentiable with existing neural ODE frameworks and CVXlayers to differentiate through the contact-dynamics optimization problem. Importantly, the contact model is \"soft\" due to the convex formulation that is regularized.\n\nOriginality-\nThis work is closely related to many other works on differentiable contact simulators. Frankly, it is not nearly as developed as: https://dl.acm.org/doi/pdf/10.1145/3414685.3417766 or http://physbam.stanford.edu/~fedkiw/papers/stanford2019-10.pdf\nA strength of this work is utilizing open-source tools, in contrast with tools like MuJoCo.\n\nQuality-\nThe overall quality of the paper is good. However, it lacks a proper comparison with LCP https://arxiv.org/pdf/2103.16021.pdf or spring-based methods: https://arxiv.org/pdf/2011.04217.pdf. Further, there are no experiments testing the physical validity of the employed soft contact model. For example, validating the model against real-world data or testing control policies in simulation.\n\nClarity-\nThe presentation of the work is clear and straightforward. The contact model, specifically, is easily recognizable to an expert in this domain and enables easy analysis of the resulting models.\n\nSignificance-\nUltimately, the development of differentiable contact-dynamics simulators has significant potential in the field of robotics and related fields. However, at this stage, the contributions in this paper have not met or advanced existing work.", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "Current limitations to this approach include:\n\nScaling to 3D. Most of the work is in 2D and scaling these approaches to 3D is very difficult. It is unclear whether or not this approach scales to more complex system, particularly in 3D. For example, rotations in 3D will require an orientation representation (e.g., quaternions, MRPs) that is unlikely to be amenable to the lower-level convex optimization problem.\n\nUseful gradients. Because a projection-based cone solver (i.e., SCS) is utilized to solver the contact dynamics problem, the gradients returned that are related to the contact modes are subgradients and potentially do not have information that is useful for finding new contact sequences. This is particularly a concern for locomotion and manipulation tasks that need to explore and discover contact sequences.\n\nCompelling examples. Most of the examples in this work are toy examples compared to the robotic systems utilized in related work which include serial-link manipulators, quadrupeds, and humanoids.", "review_text": "", "extra_scores": {"ethical_concerns": "NA", "needs_ethics_review": "No", "ethics_review_area": "", "time_spent_reviewing": "2hrs"}, "extra_text": {}}, {"review_id": "JVorkhk1be", "reviewer": "Reviewer_edmT", "summary": "This paper introduces a differentiable physics simulator for rigid body dynamics with frictional contact. It combines several existing ideas, including Lagrangian or Hamiltonian neural networks for learning dynamics, the soft contact model of MuJoCo, and differentiable optimization techniques to build a simulator that can be differentiated and trained to match trajectory data. Some model-learning benchmarks are performed against existing simulators and some simple optimal control examples are provided using the differentiable dynamics.", "questions": "", "limitations": "", "rating": 4, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "This paper's primary contribution is the combination of several existing ideas into a unified differentiable simulation infrastructure.  Since the algorithmic ideas are, on their own, not novel, I would expect to see their combination demonstrated in some compelling ways in this paper. Since simulating contact dynamics is always fraught with compromise, I feel that any paper that claims to offer better accuracy must deal with real data, rather than synthetic data from another simulator that is inevitably full of artifacts and inaccuracies. The authors primarily compare their method to a standard LCP-based simulator, and even use the LCP method's linearization approximations as a way to explain some of the observed prediction errors in their method. I highly recommend the authors expand their experimental evaluation to include data captured from real physical systems, and then to compare their method against several other state-of-the-art methods on predicting the behavior of those physical systems.", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "The authors statements on limitations and societal impact are adequate", "review_text": "", "extra_scores": {"needs_ethics_review": "No", "ethics_review_area": "", "time_spent_reviewing": "1"}, "extra_text": {}}]

Author rebuttal:

Meta-review: The core algorithmic ideas in this paper are a combination of existing proposals for differentiable simulation, and hence novelty is not clear. From an application perspective, the paper would strengthen by demonstrations on robotic systems typically used in related work which include serial-link manipulators, quadrupeds, and humanoids, for example. Furthermore, the reviewers expected to see claims of better accuracy with handling contact dynamics validated with real data as opposed to data from other simulators. As such the paper does not clear the bar for NeurIPS acceptance in its current form.

Decision: Accept (Poster)