Liu Yanfang, Wang Xu, Song Yituo, Wang Bo, Du Desong
IEEE Trans Neural Netw Learn Syst. 2025 May;36(5):8010-8024. doi: 10.1109/TNNLS.2024.3409567. Epub 2025 May 2.
Embedding the Hamiltonian formalisms into neural networks (NNs) enhances the reliability and precision of data-driven models, in which substantial research has been conducted. However, these approaches require the system to be represented in canonical coordinates, i.e., observed states should be generalized position-momentum pairs, which are typically unknown. This poses limitations when the method is applied to real-world data. Existing methods tackle this challenge through coordinate transformation or designing complex NNs to learn the symplectic phase flow of the state evolution. However, these approaches lack generality and are often difficult to train. This article proposes a versatile framework called general Hamiltonian NN (GHNN), which achieves coordinates free and handles sophisticated constraints automatically with concise form. GHNN employs two NNs, namely, an HNet to predict the Hamiltonian quantity and a JNet to predict the interconnection matrix. The gradients of the Hamiltonian quantity with respect to the input coordinates are calculated using automatic differentiation and are then multiplied by the interconnection matrix to obtain state differentials. Subsequently, ordinary differential equations (ODEs) are solved by numerical integration to provide state predictions. The accuracy and versatility of the GHNN are demonstrated through several challenging tasks, including the nonlinear simple and double pendulum, coupled pendulum, and real 3-D crane dynamic system.
将哈密顿形式体系嵌入神经网络(NNs)可提高数据驱动模型的可靠性和精度,对此已开展了大量研究。然而,这些方法要求系统用正则坐标表示,即观测状态应为广义位置 - 动量对,而这些通常是未知的。当该方法应用于实际数据时,这会带来局限性。现有方法通过坐标变换或设计复杂的神经网络来学习状态演化的辛相流来应对这一挑战。然而,这些方法缺乏通用性,且通常难以训练。本文提出了一个通用框架,称为通用哈密顿神经网络(GHNN),它无需坐标,并以简洁的形式自动处理复杂的约束。GHNN使用两个神经网络,即一个HNet来预测哈密顿量,一个JNet来预测互连矩阵。利用自动微分计算哈密顿量相对于输入坐标的梯度,然后将其与互连矩阵相乘得到状态微分。随后,通过数值积分求解常微分方程(ODEs)以提供状态预测。通过几个具有挑战性的任务,包括非线性单摆和双摆、耦合摆以及实际的三维起重机动态系统,证明了GHNN的准确性和通用性。