Directional Message Passing for Molecular Graphs | AGIDaily
AGI Daily
资讯日报词条论文人物新创
返回论文列表
摘要1 引言2 相关工作3 分子预测的要求4 有向消息传递5 基于物理的表示6 有向消息传递神经网络(DimeNet)7 实验8 结论致谢参考文献附录 A 不可区分的分子附录 B 实验设置附录 C 汇总统计附录 D DimeNet 滤波器附录 E 多目标结果
返回论文列表
目录

Directional Message Passing for Molecular Graphs

收录于 ICLR 2020;arXiv:2003.03123
打开论文来源

Directional Message Passing for Molecular Graphs

分子图上的有向消息传递

Johannes Gasteiger    Janek Groß & Stephan Günnemann Affiliation:  Technical University of Munich, Germany Email:  {j.gasteiger,grossja,guennemann}@in.tum.de

Abstract

摘要

Graph neural networks have recently achieved great successes in predicting quantum mechanical properties of molecules. These models represent a molecule as a graph using only the distance between atoms (nodes). They do not, however, consider the spatial direction from one atom to another, despite directional information playing a central role in empirical potentials for molecules, e.g. in angular potentials. To alleviate this limitation we propose directional message passing, in which we embed the messages passed between atoms instead of the atoms themselves. Each message is associated with a direction in coordinate space. These directional message embeddings are rotationally equivariant since the associated directions rotate with the molecule. We propose a message passing scheme analogous to belief propagation, which uses the directional information by transforming messages based on the angle between them. Additionally, we use spherical Bessel functions and spherical harmonics to construct theoretically well-founded, orthogonal representations that achieve better performance than the currently prevalent Gaussian radial basis representations while using fewer than \nicefrac14\nicefrac{{1}}{{4}}\nicefrac14 of the parameters. We leverage these innovations to construct the directional message passing neural network (DimeNet). DimeNet outperforms previous GNNs on average by 76 %76\text{\,}\mathrm{\%}76% on MD17 and by 31 %31\text{\,}\mathrm{\%}31% on QM9. Our implementation is available online. [^1]

图神经网络近来在预测分子量子力学性质上取得很大成功。这些模型把分子表示为图,通常只使用原子(节点)之间的距离。然而它们并不考虑从一个原子到另一个原子的空间方向,尽管方向信息在分子经验势中扮演核心角色,例如角势。为缓解这一限制,我们提出有向消息传递:嵌入在原子之间传递的消息,而非原子本身。每条消息与坐标空间中的一个方向相关联。由于关联方向随分子旋转,这些有向消息嵌入是旋转等变的。我们提出一种类似信念传播的消息传递方案,依据消息之间的夹角变换消息,从而利用方向信息。此外,我们用球贝塞尔函数与球谐函数构造理论上有根基、正交的表示,在参数少于当前流行高斯径向基表示的 \nicefrac14\nicefrac{{1}}{{4}}\nicefrac14 时仍取得更好表现。我们把这些创新整合为有向消息传递神经网络(DimeNet)。DimeNet 在 MD17 上平均优于先前 GNN 76 %76\text{\,}\mathrm{\%}76%,在 QM9 上平均优于 31 %31\text{\,}\mathrm{\%}31%。实现已开源。[^1]

1 Introduction

1 引言

In recent years scientists have started leveraging machine learning to reduce the computation time required for predicting molecular properties from a matter of hours and days to mere milliseconds. With the advent of graph neural networks (GNNs) this approach has recently experienced a small revolution, since they do not require any form of manual feature engineering and significantly outperform previous models (Gilmer et al., 2017; Schütt et al., 2017). GNNs model the complex interactions between atoms by embedding each atom in a high-dimensional space and updating these embeddings by passing messages between atoms. By predicting the potential energy these models effectively learn an empirical potential function. Classically, these functions have been modeled as the sum of four parts: (Leach, 2001)

近年来,科学家开始借助机器学习,把预测分子性质所需的计算时间从数小时、数天压缩到毫秒级。随着图神经网络(GNN)的出现,这一方向经历了一次小革命:它们无需任何手工特征工程,且显著超过先前模型(Gilmer et al., 2017; Schütt et al., 2017)。GNN 通过把每个原子嵌入高维空间、并在原子间传递消息来更新这些嵌入,从而建模原子间复杂相互作用。通过预测势能,这些模型实际上在学习经验势函数。经典上,这类函数被建模为四部分之和:(Leach, 2001)

E=Ebonds+Eangle+Etorsion+Enon-bonded,(1)E=E_{\text{bonds}}+E_{\text{angle}}+E_{\text{torsion}}+E_{\text{non-bonded}}, \tag{1}E=Ebonds​+Eangle​+Etorsion​+Enon-bonded​,(1)

where EbondsE_{\text{bonds}}Ebonds​ models the dependency on bond lengths, EangleE_{\text{angle}}Eangle​ on the angles between bonds, EtorsionE_{\text{torsion}}Etorsion​ on bond rotations, i.e. the dihedral angle between two planes defined by pairs of bonds, and Enon-bondedE_{\text{non-bonded}}Enon-bonded​ models interactions between unconnected atoms, e.g. via electrostatic or van der Waals interactions. The update messages in GNNs, however, only depend on the previous atom embeddings and the pairwise distances between atoms – not on directional information such as bond angles and rotations. Thus, GNNs lack the second and third terms of this equation and can only model them via complex higher-order interactions of messages. Extending GNNs to model them directly is not straightforward since GNNs solely rely on pairwise distances, which ensures their invariance to translation, rotation, and inversion of the molecule, which are important physical requirements.

其中 EbondsE_{\text{bonds}}Ebonds​ 建模对键长的依赖,EangleE_{\text{angle}}Eangle​ 对键角的依赖,EtorsionE_{\text{torsion}}Etorsion​ 对键旋转(即由两对键定义的两平面之间的二面角)的依赖,Enon-bondedE_{\text{non-bonded}}Enon-bonded​ 建模非键原子之间的相互作用,例如静电或范德华。然而 GNN 中的更新消息只依赖先前原子嵌入与原子间成对距离——不依赖键角与旋转等方向信息。因此 GNN 缺少该方程的第二、三项,只能经由消息的复杂高阶相互作用间接建模。把它们直接纳入并不容易:GNN 仅依赖成对距离,这保证了对分子平移、旋转与反演的不变性,而这些是重要的物理要求。

In this paper, we propose to resolve this restriction by using embeddings associated with the directions to neighboring atoms, i.e. by embedding atoms as a set of messages. These directional message embeddings are equivariant with respect to the above transformations since the directions move with the molecule. Hence, they preserve the relative directional information between neighboring atoms. We propose to let message embeddings interact based on the distance between atoms and the angle between directions. Both distances and angles are invariant to translation, rotation, and inversion of the molecule, as required. Additionally, we show that the distance and angle can be jointly represented in a principled and effective manner by using spherical Bessel functions and spherical harmonics. We leverage these innovations to construct the directional message passing neural network (DimeNet). DimeNet can learn both molecular properties and atomic forces. It is twice continuously differentiable and solely based on the atom types and coordinates, which are essential properties for performing molecular dynamics simulations. DimeNet outperforms previous GNNs on average by 76 %76\text{\,}\mathrm{\%}76% on MD17 and by 31 %31\text{\,}\mathrm{\%}31% on QM9. Our paper’s main contributions are:

本文提出用与指向邻近原子的方向相关联的嵌入来解除这一限制,也就是把原子嵌入为一组消息。这些有向消息嵌入对上述变换是等变的,因为方向随分子一起运动,从而保留邻近原子之间的相对方向信息。我们提出让消息嵌入基于原子间距离与方向夹角相互作用。距离与角度本身对分子平移、旋转与反演不变,符合要求。此外我们表明,可用球贝塞尔函数与球谐函数,以有原则且有效的方式联合表示距离与角度。我们把这些创新整合为有向消息传递神经网络(DimeNet)。DimeNet 既能学习分子性质也能学习原子力;它二阶连续可微,且仅依赖原子类型与坐标——这对分子动力学模拟至关重要。DimeNet 在 MD17 上平均优于先前 GNN 76 %76\text{\,}\mathrm{\%}76%,在 QM9 上平均优于 31 %31\text{\,}\mathrm{\%}31%。本文主要贡献是:

  1. Directional message passing, which allows GNNs to incorporate directional information by connecting recent advances in the fields of equivariance and graph neural networks as well as ideas from belief propagation and empirical potential functions such as Eq. 1.
  2. Theoretically principled orthogonal basis representations based on spherical Bessel functions and spherical harmonics. Bessel functions achieve better performance than Gaussian radial basis functions while reducing the radial basis dimensionality by 4x or more.
  3. The Directional Message Passing Neural Network (DimeNet): A novel GNN that leverages these innovations to set the new state of the art for molecular predictions and is suitable both for predicting molecular properties and for molecular dynamics simulations.
  1. 有向消息传递:把等变性与图神经网络领域的近期进展,以及信念传播与经验势函数(如式 1)中的想法连接起来,使 GNN 能纳入方向信息。
  2. 基于球贝塞尔函数与球谐函数、理论上有原则的正交基表示。贝塞尔函数表现优于高斯径向基函数,同时把径向基维数降低 4 倍或更多。
  3. 有向消息传递神经网络(DimeNet):利用上述创新刷新分子预测当时最优,并同时适用于分子性质预测与分子动力学模拟。

2 Related work

2 相关工作

ML for molecules. The classical way of using machine learning for predicting molecular properties is combining an expressive, hand-crafted representation of the atomic neighborhood (Bartók et al., 2013) with Gaussian processes (Bartók et al., 2010; Bartók et al., 2017; Chmiela et al., 2017) or neural networks (Behler & Parrinello, 2007). Recently, these methods have largely been superseded by graph neural networks, which do not require any hand-crafted features but learn representations solely based on the atom types and coordinates molecules (Duvenaud et al., 2015; Gilmer et al., 2017; Schütt et al., 2017; Hy et al., 2018; Unke & Meuwly, 2019). Our proposed message embeddings can also be interpreted as directed edge embeddings or embeddings on the line graph (Chen et al., 2019b). (Undirected) edge embeddings have already been used in previous GNNs for molecules (Jørgensen et al., 2018; Chen et al., 2019a). However, these GNNs use both node and edge embeddings and do not leverage any directional information.

分子上的机器学习。 用机器学习预测分子性质的经典做法,是把富有表达力的手工原子邻域表示(Bartók et al., 2013)与高斯过程(Bartók et al., 2010; Bartók et al., 2017; Chmiela et al., 2017)或神经网络(Behler & Parrinello, 2007)结合。近来这些方法已大多被图神经网络取代:后者无需手工特征,仅基于原子类型与坐标学习表示(Duvenaud et al., 2015; Gilmer et al., 2017; Schütt et al., 2017; Hy et al., 2018; Unke & Meuwly, 2019)。我们提出的消息嵌入也可解释为有向边嵌入,或线图上的嵌入(Chen et al., 2019b)。(无向)边嵌入已在先前分子 GNN 中使用(Jørgensen et al., 2018; Chen et al., 2019a)。但这些 GNN 同时使用节点与边嵌入,且不利用任何方向信息。

Graph neural networks. GNNs were first proposed in the 90s (Baskin et al., 1997; Sperduti & Starita, 1997) and 00s (Gori et al., 2005; Scarselli et al., 2009). General GNNs have been largely inspired by their application to molecular graphs and have started to achieve breakthrough performance in various tasks at around the same time the molecular variants did (Kipf & Welling, 2017; Gasteiger et al., 2019; Zambaldi et al., 2019). Some recent progress has been focused on GNNs that are more powerful than the 1-Weisfeiler-Lehman test of isomorphism (Morris et al., 2019; Maron et al., 2019). However, for molecular predictions these models are significantly outperformed by GNNs focused on molecules (see Sec. 7). Some recent GNNs have incorporated directional information by considering the change in local coordinate systems per atom (Ingraham et al., 2019). However, this approach breaks permutation invariance and is therefore only applicable to chain-like molecules (e.g. proteins).

图神经网络。 GNN 最早于 90 年代(Baskin et al., 1997; Sperduti & Starita, 1997)与 00 年代(Gori et al., 2005; Scarselli et al., 2009)提出。一般 GNN 很大程度受到其在分子图上应用的启发,并大约在分子变体取得突破的同一时期,开始在多种任务上取得突破性表现(Kipf & Welling, 2017; Gasteiger et al., 2019; Zambaldi et al., 2019)。近期进展有一部分聚焦比 1-Weisfeiler-Lehman 同构检验更强的 GNN(Morris et al., 2019; Maron et al., 2019)。但对分子预测,这些模型显著落后于专注分子的 GNN(见第 7 节)。一些近期 GNN 通过考虑每个原子局部坐标系的变化来纳入方向信息(Ingraham et al., 2019)。但该方法破坏置换不变性,因此只适用于链状分子(如蛋白质)。

Equivariant neural networks. Group equivariance as a principle of modern machine learning was first proposed by Cohen & Welling (2016). Following work has generalized this principle to spheres (Cohen et al., 2018), molecules (Thomas et al., 2018), volumetric data (Weiler et al., 2018), and general manifolds (Cohen et al., 2019). Equivariance with respect to continuous rotations has been achieved so far by switching back and forth between Fourier and coordinate space in each layer (Cohen et al., 2018) or by using a fully Fourier space model (Kondor et al., 2018; Anderson et al., 2019). The former introduces major computational overhead and the latter imposes significant constraints on model construction, such as the inability of using non-linearities. Our proposed solution does not suffer from either of those limitations.

等变神经网络。 把群等变性作为现代机器学习原则,由 Cohen & Welling (2016) 首次提出。后续工作把该原则推广到球面(Cohen et al., 2018)、分子(Thomas et al., 2018)、体数据(Weiler et al., 2018)与一般流形(Cohen et al., 2019)。迄今对连续旋转的等变性,要么每层在傅里叶空间与坐标空间之间来回切换(Cohen et al., 2018),要么使用完全傅里叶空间模型(Kondor et al., 2018; Anderson et al., 2019)。前者引入显著计算开销,后者对模型构造施加重大约束,例如无法使用非线性。我们提出的方案不受这两类限制。

3 Requirements for molecular predictions

3 分子预测的要求

In recent years machine learning has been used to predict a wide variety of molecular properties, both low-level quantum mechanical properties such as potential energy, energy of the highest occupied molecular orbital (HOMO), and the dipole moment and high-level properties such as toxicity, permeability, and adverse drug reactions (Wu et al., 2018). In this work we will focus on scalar regression targets, i.e. targets t∈Rt\in\mathbb{R}t∈R. A molecule is uniquely defined by the atomic numbers z={z1,…,zN}{\bm{z}}=\{z_{1},\ldots,z_{N}\}z={z1​,…,zN​} and positions X={x1,…,xN}{\bm{X}}=\{{\bm{x}}_{1},\ldots,{\bm{x}}_{N}\}X={x1​,…,xN​}. Some models additionally use auxiliary information Θ{\bm{\Theta}}Θ such as bond types or electronegativity of the atoms. We do not include auxiliary features in this work since they are hand-engineered and non-essential. In summary, we define an ML model for molecular prediction with parameters θ\thetaθ via fθ:{X,z}→Rf_{\theta}:\{{\bm{X}},{\bm{z}}\}\rightarrow\mathbb{R}fθ​:{X,z}→R.

近年来机器学习被用于预测多种多样的分子性质,既有势能、最高占据分子轨道(HOMO)能量、偶极矩等底层量子力学性质,也有毒性、渗透性、药物不良反应等高层性质(Wu et al., 2018)。本文聚焦标量回归目标,即目标 t∈Rt\in\mathbb{R}t∈R。分子由原子序数 z={z1,…,zN}{\bm{z}}=\{z_{1},\ldots,z_{N}\}z={z1​,…,zN​} 与位置 X={x1,…,xN}{\bm{X}}=\{{\bm{x}}_{1},\ldots,{\bm{x}}_{N}\}X={x1​,…,xN​} 唯一确定。一些模型还使用键型或原子电负性等辅助信息 Θ{\bm{\Theta}}Θ。本文不纳入辅助特征,因为它们依赖手工工程且非必需。总之,我们把参数为 θ\thetaθ 的分子预测机器学习模型定义为 fθ:{X,z}→Rf_{\theta}:\{{\bm{X}},{\bm{z}}\}\rightarrow\mathbb{R}fθ​:{X,z}→R。

Symmetries and invariances. All molecular predictions must obey some basic laws of physics, either explicitly or implicitly. One important example of such are the fundamental symmetries of physics and their associated invariances. In principle, these invariances can be learned by any neural network via corresponding weight matrix symmetries (Ravanbakhsh et al., 2017). However, not explicitly incorporating them into the model introduces duplicate weights and increases training time and complexity. The most essential symmetries are translational and rotational invariance (follows from homogeneity and isotropy), permutation invariance (follows from the indistinguishability of particles), and symmetry under parity, i.e. under sign flips of single spatial coordinates.

对称性与不变性。 所有分子预测都必须显式或隐式服从一些基本物理定律。其中一个重要例子是物理学的基本对称性及其关联的不变性。原则上,任何神经网络都可通过相应的权重矩阵对称性学习这些不变性(Ravanbakhsh et al., 2017)。但不显式纳入模型会引入重复权重,并增加训练时间与复杂度。最本质的对称性是平移与旋转不变性(由均匀性与各向同性推出)、置换不变性(由粒子不可区分性推出),以及宇称下的对称性,即单个空间坐标翻转符号。

Molecular dynamics. Additional requirements arise when the model should be suitable for molecular dynamics (MD) simulations and predict the forces Fi{\bm{F}}_{i}Fi​ acting on each atom. The force field is a conservative vector field since it must satisfy conservation of energy (the necessity of which follows from homogeneity of time (Noether, 1918)). The easiest way of defining a conservative vector field is via the gradient of a potential function. We can leverage this fact by predicting a potential instead of the forces and then obtaining the forces via backpropagation to the atom coordinates, i.e. Fi(X,z)=−∂∂xifθ(X,z){\bm{F}}_{i}({\bm{X}},{\bm{z}})=-\frac{\partial}{\partial{\bm{x}}_{i}}f_{\theta}({\bm{X}},{\bm{z}})Fi​(X,z)=−∂xi​∂​fθ​(X,z). We can even directly incorporate the forces in the training loss and directly train a model for MD simulations (Pukrittayakamee et al., 2009):

分子动力学。 当模型要适用于分子动力学(MD)模拟并预测作用在每个原子上的力 Fi{\bm{F}}_{i}Fi​ 时,还会有额外要求。力场是保守向量场,因为它必须满足能量守恒(其必要性由时间均匀性推出(Noether, 1918))。定义保守向量场最容易的方式是经由势函数的梯度。我们可以利用这一点:预测势而非力,再通过对原子坐标反向传播得到力,即 Fi(X,z)=−∂∂xifθ(X,z){\bm{F}}_{i}({\bm{X}},{\bm{z}})=-\frac{\partial}{\partial{\bm{x}}_{i}}f_{\theta}({\bm{X}},{\bm{z}})Fi​(X,z)=−∂xi​∂​fθ​(X,z)。我们甚至可以把力直接写进训练损失,直接训练用于 MD 模拟的模型(Pukrittayakamee et al., 2009):

LMD(X,z)=∣fθ(X,z)−t^(X,z)∣+ρ3N∑i=1N∑α=13∣−∂fθ(X,z)∂xiα−F^iα(X,z)∣,(2)\mathcal{L}_{\text{MD}}({\bm{X}},{\bm{z}})=\left|f_{\theta}({\bm{X}},{\bm{z}})-\hat{t}({\bm{X}},{\bm{z}})\right|+\frac{\rho}{3N}\sum_{i=1}^{N}\sum_{\alpha=1}^{3}\left|-\frac{\partial f_{\theta}({\bm{X}},{\bm{z}})}{\partial{\bm{x}}_{i\alpha}}-\hat{F}_{i\alpha}({\bm{X}},{\bm{z}})\right|, \tag{2}LMD​(X,z)=​fθ​(X,z)−t^(X,z)​+3Nρ​i=1∑N​α=1∑3​​−∂xiα​∂fθ​(X,z)​−F^iα​(X,z)​,(2)

where the target t^=E^\hat{t}=\hat{E}t^=E^ is the ground-truth energy (usually available as well), F^\hat{{\bm{F}}}F^ are the ground-truth forces, and the hyperparameter ρ\rhoρ sets the forces’ loss weight. For stable simulations Fi{\bm{F}}_{i}Fi​ must be continuously differentiable and the model fθf_{\theta}fθ​ itself therefore twice continuously differentiable. We hence cannot use discontinuous transformations such as ReLU non-linearities. Furthermore, since the atom positions X{\bm{X}}X can change arbitrarily we cannot use pre-computed auxiliary information Θ{\bm{\Theta}}Θ such as bond types.

其中目标 t^=E^\hat{t}=\hat{E}t^=E^ 是真实能量(通常也可用),F^\hat{{\bm{F}}}F^ 是真实力,超参 ρ\rhoρ 设定力损失的权重。为使模拟稳定,Fi{\bm{F}}_{i}Fi​ 必须连续可微,因而模型 fθf_{\theta}fθ​ 本身须二阶连续可微。因此我们不能使用 ReLU 一类不连续变换。此外,由于原子位置 X{\bm{X}}X 可任意变化,我们也不能使用键型等预计算的辅助信息 Θ{\bm{\Theta}}Θ。

4 Directional message passing

4 有向消息传递

Graph neural networks. Graph neural networks treat the molecule as a graph, in which the nodes are atoms and edges are defined either via a predefined molecular graph or simply by connecting atoms that lie within a cutoff distance ccc. Each edge is associated with a pairwise distance between atoms dij=∥xi−xj∥2d_{ij}=\|{\bm{x}}_{i}-{\bm{x}}_{j}\|_{2}dij​=∥xi​−xj​∥2​. GNNs implement all of the above physical invariances by construction since they only use pairwise distances and not the full atom coordinates. However, note that a predefined molecular graph or a step function-like cutoff cannot be used for MD simulations since this would introduce discontinuities in the energy landscape. GNNs represent each atom iii via an atom embedding hi∈RH{\bm{h}}_{i}\in\mathbb{R}^{H}hi​∈RH. The atom embeddings are updated in each layer by passing messages along the molecular edges. Messages are usually transformed based on an edge embedding e(ij)∈RHe{\bm{e}}_{(ij)}\in\mathbb{R}^{H_{\text{e}}}e(ij)​∈RHe​ and summed over the atom’s neighbors Ni\mathcal{N}_{i}Ni​, i.e. the embeddings are updated in layer lll via

图神经网络。 图神经网络把分子当作图:节点是原子,边要么由预定义分子图给出,要么简单连接截断距离 ccc 内的原子。每条边关联原子间成对距离 dij=∥xi−xj∥2d_{ij}=\|{\bm{x}}_{i}-{\bm{x}}_{j}\|_{2}dij​=∥xi​−xj​∥2​。由于只使用成对距离而非完整原子坐标,GNN 从构造上实现了上述全部物理不变性。但注意:预定义分子图或阶跃式截断不能用于 MD 模拟,因为会在能量景观中引入不连续。GNN 用原子嵌入 hi∈RH{\bm{h}}_{i}\in\mathbb{R}^{H}hi​∈RH 表示每个原子 iii。各层通过沿分子边传递消息更新原子嵌入。消息通常基于边嵌入 e(ij)∈RHe{\bm{e}}_{(ij)}\in\mathbb{R}^{H_{\text{e}}}e(ij)​∈RHe​ 变换,并对原子的邻居 Ni\mathcal{N}_{i}Ni​ 求和,即第 lll 层嵌入按如下更新

hi(l+1)=fupdate(hi(l),∑j∈Nifint(hj(l),e(ij)(l))),(3){\bm{h}}_{i}^{(l+1)}=f_{\text{update}}({\bm{h}}_{i}^{(l)},\sum_{j\in\mathcal{N}_{i}}f_{\text{int}}({\bm{h}}_{j}^{(l)},{\bm{e}}_{(ij)}^{(l)})), \tag{3}hi(l+1)​=fupdate​(hi(l)​,j∈Ni​∑​fint​(hj(l)​,e(ij)(l)​)),(3)

with the update function fupdatef_{\text{update}}fupdate​ and the interaction function fintf_{\text{int}}fint​, which are both commonly implemented using neural networks. The edge embeddings e(ij)(l){\bm{e}}_{(ij)}^{(l)}e(ij)(l)​ usually only depend on the interatomic distances, but can also incorporate additional bond information (Gilmer et al., 2017) or be recursively updated in each layer using the neighboring atom embeddings (Jørgensen et al., 2018).

其中更新函数 fupdatef_{\text{update}}fupdate​ 与相互作用函数 fintf_{\text{int}}fint​ 通常都用神经网络实现。边嵌入 e(ij)(l){\bm{e}}_{(ij)}^{(l)}e(ij)(l)​ 通常只依赖原子间距离,但也可纳入额外键信息(Gilmer et al., 2017),或用邻近原子嵌入在每层递归更新(Jørgensen et al., 2018)。

Directionality. In principle, the pairwise distance matrix contains the full geometrical information of the molecule. However, GNNs do not use the full distance matrix since this would mean passing messages globally between all pairs of atoms, which increases computational complexity and can lead to overfitting. Instead, they usually use a cutoff distance ccc, which means they cannot distinguish between certain molecules (Xu et al., 2019). E.g. at a cutoff of roughly 2 \SIUnitSymbolAngstrom2\text{\,}\mathrm{\SIUnitSymbolAngstrom}2\SIUnitSymbolAngstrom a regular GNN would not be able to distinguish between a hexagonal (e.g. Cyclohexane) and two triangular molecules (e.g. Cyclopropane) with the same bond lengths since the neighborhoods of each atom are exactly the same for both (see Appendix, Fig. 8). This problem can be solved by modeling the directions to neighboring atoms instead of just their distances. A principled way of doing so while staying invariant to a transformation group GGG (such as described in Sec. 3) is via group-equivariance (Cohen & Welling, 2016). A function f:X→Yf:X\rightarrow Yf:X→Y is defined as being equivariant if f(φgX(x))=φgY(f(x))f(\varphi_{g}^{X}(x))=\varphi_{g}^{Y}(f(x))f(φgX​(x))=φgY​(f(x)), with the group action in the input and output space φgX\varphi_{g}^{X}φgX​ and φgY\varphi_{g}^{Y}φgY​. However, equivariant CNNs only achieve equivariance with respect to a discrete set of rotations (Cohen & Welling, 2016). For a precise prediction of molecular properties we need continuous equivariance with respect to rotations, i.e. to the SO(3) group.

方向性。 原则上,成对距离矩阵包含分子的完整几何信息。但 GNN 并不使用完整距离矩阵,因为那意味着在所有原子对之间全局传消息,既增加计算复杂度,也容易过拟合。它们通常使用截断距离 ccc,因而无法区分某些分子(Xu et al., 2019)。例如在约 2 \SIUnitSymbolAngstrom2\text{\,}\mathrm{\SIUnitSymbolAngstrom}2\SIUnitSymbolAngstrom 的截断下,常规 GNN 无法区分键长相同的六边形分子(如环己烷)与两个三角形分子(如环丙烷),因为每个原子的邻域完全相同(见附录图 8)。通过建模指向邻近原子的方向而非仅距离,可以解决该问题。在对变换群 GGG(如第 3 节所述)保持不变的同时有原则地做到这一点,一种方式是群等变性(Cohen & Welling, 2016)。函数 f:X→Yf:X\rightarrow Yf:X→Y 定义为等变,若 f(φgX(x))=φgY(f(x))f(\varphi_{g}^{X}(x))=\varphi_{g}^{Y}(f(x))f(φgX​(x))=φgY​(f(x)),其中 φgX\varphi_{g}^{X}φgX​ 与 φgY\varphi_{g}^{Y}φgY​ 分别为输入与输出空间中的群作用。但等变 CNN 仅对离散旋转集合实现等变(Cohen & Welling, 2016)。对分子性质的精确预测,我们需要相对旋转的连续等变,即相对 SO(3) 群。

Directional embeddings. We solve this problem by noting that an atom by itself is rotationally invariant. This invariance is only broken by neighboring atoms that interact with it, i.e. those inside the cutoff ccc. Since each neighbor breaks up to one rotational invariance they also introduce additional degrees of freedom, which we need to represent in our model. We can do so by generating a separate embedding mji{\bm{m}}_{ji}mji​ for each atom iii and neighbor jjj by applying the same learned filter in the direction of each neighboring atom (in contrast to equivariant CNNs, which apply filters in fixed, global directions). These directional embeddings are equivariant with respect to global rotations since the associated directions rotate with the molecule and hence conserve the relative directional information between neighbors.

有向嵌入。 我们注意到:原子本身是旋转不变的。这种不变性只被与之相互作用的邻近原子打破,即截断 ccc 内的原子。每个邻居最多打破一重旋转不变性,同时也引入额外自由度,需要在模型中表示。我们可以通过为每个原子 iii 与邻居 jjj 生成单独嵌入 mji{\bm{m}}_{ji}mji​ 来做到这一点:沿每个邻近原子的方向应用同一学得滤波器(对比等变 CNN 在固定全局方向上应用滤波器)。这些有向嵌入对全局旋转等变,因为关联方向随分子旋转,从而保留邻居之间的相对方向信息。

Representation via joint 2D basis. We use the directional information associated with each embedding by leveraging the angle α(kj,ji)=∠xkxjxi\alpha_{(kj,ji)}=\angle{\bm{x}}_{k}{\bm{x}}_{j}{\bm{x}}_{i}α(kj,ji)​=∠xk​xj​xi​ when aggregating the neighboring embeddings mkj{\bm{m}}_{kj}mkj​ of mji{\bm{m}}_{ji}mji​. We combine the angle with the interatomic distance dkjd_{kj}dkj​ associated with the incoming message mkj{\bm{m}}_{kj}mkj​ and jointly represent both in aSBF(kj,ji)∈RNSHBF⋅NSRBF{\bm{a}}_{\text{SBF}}^{(kj,ji)}\in\mathbb{R}^{N_{\text{SHBF}}\cdot N_{\text{SRBF}}}aSBF(kj,ji)​∈RNSHBF​⋅NSRBF​ using a 2D representation based on spherical Bessel functions and spherical harmonics, as explained in Sec. 5. We empirically found that this basis representation provides a better inductive bias than the raw angle alone. Note that by only using interatomic distances and angles our model becomes invariant to rotations.

用联合二维基表示。 在聚合 mji{\bm{m}}_{ji}mji​ 的邻近嵌入 mkj{\bm{m}}_{kj}mkj​ 时,我们利用与每个嵌入关联的方向信息,借助夹角 α(kj,ji)=∠xkxjxi\alpha_{(kj,ji)}=\angle{\bm{x}}_{k}{\bm{x}}_{j}{\bm{x}}_{i}α(kj,ji)​=∠xk​xj​xi​。我们把该角度与传入消息 mkj{\bm{m}}_{kj}mkj​ 关联的原子间距离 dkjd_{kj}dkj​ 结合,并用基于球贝塞尔函数与球谐函数的二维表示,在 aSBF(kj,ji)∈RNSHBF⋅NSRBF{\bm{a}}_{\text{SBF}}^{(kj,ji)}\in\mathbb{R}^{N_{\text{SHBF}}\cdot N_{\text{SRBF}}}aSBF(kj,ji)​∈RNSHBF​⋅NSRBF​ 中联合表示二者,见第 5 节。经验上发现,该基表示比仅用原始角度提供更好的归纳偏置。注意:仅使用原子间距离与角度,使模型对旋转不变。

Figure 1

Figure 1: Aggregation scheme for message embeddings.

图 1:消息嵌入的聚合方案。

Message embeddings. The directional embedding mji{\bm{m}}_{ji}mji​ associated with the atom pair jijiji can be thought of as a message being sent from atom jjj to atom iii. Hence, in analogy to belief propagation, we embed each atom iii using a set of incoming messages mji{\bm{m}}_{ji}mji​, i.e. hi=∑j∈Nimji{\bm{h}}_{i}=\sum_{j\in\mathcal{N}_{i}}{\bm{m}}_{ji}hi​=∑j∈Ni​​mji​, and update the message mji{\bm{m}}_{ji}mji​ based on the incoming messages mkj{\bm{m}}_{kj}mkj​ (Yedidia et al., 2003). Hence, as illustrated in Fig. 1, we define the update function and aggregation scheme for message embeddings as

消息嵌入。 与原子对 jijiji 关联的有向嵌入 mji{\bm{m}}_{ji}mji​ 可视为从原子 jjj 发往原子 iii 的消息。因此,类比信念传播,我们用一组传入消息 mji{\bm{m}}_{ji}mji​ 嵌入每个原子 iii,即 hi=∑j∈Nimji{\bm{h}}_{i}=\sum_{j\in\mathcal{N}_{i}}{\bm{m}}_{ji}hi​=∑j∈Ni​​mji​,并基于传入消息 mkj{\bm{m}}_{kj}mkj​ 更新消息 mji{\bm{m}}_{ji}mji​(Yedidia et al., 2003)。于是如图 1 所示,我们把消息嵌入的更新函数与聚合方案定义为

mji(l+1)=fupdate(mji(l),∑k∈Nj∖{i}fint(mkj(l),eRBF(ji),aSBF(kj,ji))),(4){\bm{m}}_{ji}^{(l+1)}=f_{\text{update}}({\bm{m}}_{ji}^{(l)},\sum_{k\in\mathcal{N}_{j}\setminus\{i\}}f_{\text{int}}({\bm{m}}_{kj}^{(l)},{\bm{e}}_{\text{RBF}}^{(ji)},{\bm{a}}_{\text{SBF}}^{(kj,ji)})), \tag{4}mji(l+1)​=fupdate​(mji(l)​,k∈Nj​∖{i}∑​fint​(mkj(l)​,eRBF(ji)​,aSBF(kj,ji)​)),(4)

where eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​ denotes the radial basis function representation of the interatomic distance djid_{ji}dji​, which will be discussed in Sec. 5. We found this aggregation scheme to not only have a nice analogy to belief propagation, but also to empirically perform better than alternatives. Note that since fintf_{\text{int}}fint​ now incorporates the angle between atom pairs, or bonds, we have enabled our model to directly learn the angular potential EangleE_{\text{angle}}Eangle​, the second term in Eq. 1. Moreover, the message embeddings are essentially embeddings of atom pairs, as used by the provably more powerful GNNs based on higher-order Weisfeiler-Lehman tests of isomorphism. Our model can therefore provably distinguish molecules that a regular GNN cannot (e.g. the previous example of a hexagonal and two triangular molecules) (Morris et al., 2019).

其中 eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​ 表示原子间距离 djid_{ji}dji​ 的径向基函数表示,将在第 5 节讨论。我们发现该聚合方案不仅与信念传播有漂亮类比,经验表现也优于替代方案。注意:由于 fintf_{\text{int}}fint​ 现已纳入原子对(或键)之间的夹角,模型可直接学习角势 EangleE_{\text{angle}}Eangle​,即式 1 的第二项。此外,消息嵌入本质上是原子对嵌入,正如基于高阶 Weisfeiler-Lehman 同构检验、可证更强的 GNN 所使用的。因此我们的模型可证能区分常规 GNN 无法区分的分子(例如前面六边形与两个三角形分子的例子)(Morris et al., 2019)。

5 Physically based representations

5 基于物理的表示

Representing distances and angles. For the interaction function fintf_{\text{int}}fint​ in Eq. 4 we use a joint representation aSBF(kj,ji){\bm{a}}_{\text{SBF}}^{(kj,ji)}aSBF(kj,ji)​ of the angles α(kj,ji)\alpha_{(kj,ji)}α(kj,ji)​ between message embeddings and the interatomic distances dkj=∥xk−xj∥2d_{kj}=\|{\bm{x}}_{k}-{\bm{x}}_{j}\|_{2}dkj​=∥xk​−xj​∥2​, as well as a representation eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​ of the distances djid_{ji}dji​. Earlier works have used a set of Gaussian radial basis functions to represent interatomic distances, with tightly spaced means that are distributed e.g. uniformly (Schütt et al., 2017) or exponentially (Unke & Meuwly, 2019). Similar in spirit to the functional bases used by steerable CNNs (Cohen & Welling, 2017; Cheng et al., 2019) we propose to use an orthogonal basis instead, which reduces redundancy and thus improves parameter efficiency. Furthermore, a basis chosen according to the properties of the modeled system can even provide a helpful inductive bias. We therefore derive a proper basis representation for quantum systems next.

表示距离与角度。 对式 4 中的相互作用函数 fintf_{\text{int}}fint​,我们使用消息嵌入之间夹角 α(kj,ji)\alpha_{(kj,ji)}α(kj,ji)​ 与原子间距离 dkj=∥xk−xj∥2d_{kj}=\|{\bm{x}}_{k}-{\bm{x}}_{j}\|_{2}dkj​=∥xk​−xj​∥2​ 的联合表示 aSBF(kj,ji){\bm{a}}_{\text{SBF}}^{(kj,ji)}aSBF(kj,ji)​,以及对距离 djid_{ji}dji​ 的表示 eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​。早期工作用一组高斯径向基函数表示原子间距离,均值紧密排布,例如均匀分布(Schütt et al., 2017)或指数分布(Unke & Meuwly, 2019)。与可转向 CNN 所用函数基的精神类似(Cohen & Welling, 2017; Cheng et al., 2019),我们提出改用正交基,以减少冗余并提升参数效率。此外,按所建模系统性质选取的基甚至可提供有益的归纳偏置。因此我们接下来推导量子系统的恰当基表示。

From Schrödinger to Fourier-Bessel. To construct a basis representation in a principled manner we first consider the space of possible solutions. Our model aims at approximating results of density functional theory (DFT) calculations, i.e. results given by an electron density <Ψ(d)∣Ψ(d)>\left<\Psi({\bm{d}})|\Psi({\bm{d}})\right>⟨Ψ(d)∣Ψ(d)⟩, with the electron wave function Ψ(d)\Psi({\bm{d}})Ψ(d) and d=xk−xj{\bm{d}}={\bm{x}}_{k}-{\bm{x}}_{j}d=xk​−xj​. The solution space of Ψ(d)\Psi({\bm{d}})Ψ(d) is defined by the time-independent Schrödinger equation (−ℏ22m∇2+V(d))Ψ(d)=EΨ(d)\left(-\frac{\hbar^{2}}{2m}\nabla^{2}+V({\bm{d}})\right)\Psi({\bm{d}})=E\Psi({\bm{d}})(−2mℏ2​∇2+V(d))Ψ(d)=EΨ(d), with constant mass mmm and energy EEE. We do not know the potential V(d)V({\bm{d}})V(d) and so choose it in an uninformative way by simply setting it to 0 inside the cutoff distance ccc (up to which we pass messages between atoms) and to ∞\infty∞ outside. Hence, we arrive at the Helmholtz equation (∇2+k2)Ψ(d)=0(\nabla^{2}+k^{2})\Psi({\bm{d}})=0(∇2+k2)Ψ(d)=0, with the wave number k=2mEℏk=\frac{\sqrt{2mE}}{\hbar}k=ℏ2mE​​ and the boundary condition Ψ(c)=0\Psi(c)=0Ψ(c)=0 at the cutoff ccc. Separation of variables in polar coordinates (d,α,φ)(d,\alpha,\varphi)(d,α,φ) yields the solution (Griffiths & Schroeter, 2018)

从薛定谔到傅里叶–贝塞尔。 为有原则地构造基表示,我们先考虑可能解的空间。我们的模型旨在逼近密度泛函理论(DFT)计算的结果,即由电子密度 <Ψ(d)∣Ψ(d)>\left<\Psi({\bm{d}})|\Psi({\bm{d}})\right>⟨Ψ(d)∣Ψ(d)⟩ 给出的结果,其中电子波函数为 Ψ(d)\Psi({\bm{d}})Ψ(d),d=xk−xj{\bm{d}}={\bm{x}}_{k}-{\bm{x}}_{j}d=xk​−xj​。Ψ(d)\Psi({\bm{d}})Ψ(d) 的解空间由定态薛定谔方程 (−ℏ22m∇2+V(d))Ψ(d)=EΨ(d)\left(-\frac{\hbar^{2}}{2m}\nabla^{2}+V({\bm{d}})\right)\Psi({\bm{d}})=E\Psi({\bm{d}})(−2mℏ2​∇2+V(d))Ψ(d)=EΨ(d) 定义,质量 mmm 与能量 EEE 为常数。我们不知道势 V(d)V({\bm{d}})V(d),因而以无信息方式选取:在截断距离 ccc 内(在此范围内原子间传消息)简单置为 0,在外置为 ∞\infty∞。于是得到亥姆霍兹方程 (∇2+k2)Ψ(d)=0(\nabla^{2}+k^{2})\Psi({\bm{d}})=0(∇2+k2)Ψ(d)=0,波数 k=2mEℏk=\frac{\sqrt{2mE}}{\hbar}k=ℏ2mE​​,边界条件在截断 ccc 处 Ψ(c)=0\Psi(c)=0Ψ(c)=0。在极坐标 (d,α,φ)(d,\alpha,\varphi)(d,α,φ) 中分离变量得到解(Griffiths & Schroeter, 2018)

Ψ(d,α,φ)=∑l=0∞∑m=−ll(almjl(kd)+blmyl(kd))Ylm(α,φ),(5)\Psi(d,\alpha,\varphi)=\sum_{l=0}^{\infty}\sum_{m=-l}^{l}(a_{lm}j_{l}(kd)+b_{lm}y_{l}(kd))Y_{l}^{m}(\alpha,\varphi), \tag{5}Ψ(d,α,φ)=l=0∑∞​m=−l∑l​(alm​jl​(kd)+blm​yl​(kd))Ylm​(α,φ),(5)

Figure 2

Figure 2: 2D spherical Fourier-Bessel basis a~SBF,ln(d,α)\tilde{a}_{\text{SBF},ln}(d,\alpha)a~SBF,ln​(d,α).

图 2:二维球面傅里叶–贝塞尔基 a~SBF,ln(d,α)\tilde{a}_{\text{SBF},ln}(d,\alpha)a~SBF,ln​(d,α)。

with the spherical Bessel functions of the first and second kind jlj_{l}jl​ and yly_{l}yl​ and the spherical harmonics YlmY_{l}^{m}Ylm​. As common in physics we only use the regular solutions, i.e. those that do not approach −∞-\infty−∞ at the origin, and hence set blm=0b_{lm}=0blm​=0. Recall that our first goal is to construct a joint 2D basis for dkjd_{kj}dkj​ and α(kj,ji)\alpha_{(kj,ji)}α(kj,ji)​, i.e. a function that depends on ddd and a single angle α\alphaα. To achieve this we set m=0m=0m=0 and obtain ΨSBF(d,α)=∑laljl(kd)Yl0(α)\Psi_{\text{SBF}}(d,\alpha)=\sum_{l}a_{l}j_{l}(kd)Y_{l}^{0}(\alpha)ΨSBF​(d,α)=∑l​al​jl​(kd)Yl0​(α). The boundary conditions are satisfied by setting k=zlnck=\frac{z_{ln}}{c}k=czln​​, where zlnz_{ln}zln​ is the nnn-th root of the lll-order Bessel function, which are precomputed numerically. Normalizing ΨSBF\Psi_{\text{SBF}}ΨSBF​ inside the cutoff distance ccc yields the 2D spherical Fourier-Bessel basis a~SBF(kj,ji)∈RNSHBF⋅NSRBF\tilde{{\bm{a}}}_{\text{SBF}}^{(kj,ji)}\in\mathbb{R}^{N_{\text{SHBF}}\cdot N_{\text{SRBF}}}a~SBF(kj,ji)​∈RNSHBF​⋅NSRBF​, which is illustrated in Fig. 3 and defined by

其中 jlj_{l}jl​ 与 yly_{l}yl​ 为一类与二类球贝塞尔函数,YlmY_{l}^{m}Ylm​ 为球谐函数。按物理学惯例我们只使用正则解,即在原点不趋于 −∞-\infty−∞ 的解,因而令 blm=0b_{lm}=0blm​=0。回顾我们的第一个目标是为 dkjd_{kj}dkj​ 与 α(kj,ji)\alpha_{(kj,ji)}α(kj,ji)​ 构造联合二维基,即依赖 ddd 与单一角度 α\alphaα 的函数。为此令 m=0m=0m=0,得到 ΨSBF(d,α)=∑laljl(kd)Yl0(α)\Psi_{\text{SBF}}(d,\alpha)=\sum_{l}a_{l}j_{l}(kd)Y_{l}^{0}(\alpha)ΨSBF​(d,α)=∑l​al​jl​(kd)Yl0​(α)。通过令 k=zlnck=\frac{z_{ln}}{c}k=czln​​ 满足边界条件,其中 zlnz_{ln}zln​ 为 lll 阶贝塞尔函数的第 nnn 个根,数值预计算得到。在截断距离 ccc 内归一化 ΨSBF\Psi_{\text{SBF}}ΨSBF​,得到二维球面傅里叶–贝塞尔基 a~SBF(kj,ji)∈RNSHBF⋅NSRBF\tilde{{\bm{a}}}_{\text{SBF}}^{(kj,ji)}\in\mathbb{R}^{N_{\text{SHBF}}\cdot N_{\text{SRBF}}}a~SBF(kj,ji)​∈RNSHBF​⋅NSRBF​,如图 3 所示,定义为

a~SBF,ln(d,α)=2c3jl+12(zln)jl(zlncd)Yl0(α),(6)\tilde{a}_{\text{SBF},ln}(d,\alpha)=\sqrt{\frac{2}{c^{3}j_{l+1}^{2}(z_{ln})}}j_{l}(\frac{z_{ln}}{c}d)Y_{l}^{0}(\alpha), \tag{6}a~SBF,ln​(d,α)=c3jl+12​(zln​)2​​jl​(czln​​d)Yl0​(α),(6)

with l∈[0..NSHBF−1]l\in[0\mathinner{\ldotp\ldotp}N_{\text{SHBF}}-1]l∈[0..NSHBF​−1] and n∈[1..NSRBF]n\in[1\mathinner{\ldotp\ldotp}N_{\text{SRBF}}]n∈[1..NSRBF​]. Our second goal is constructing a radial basis for djid_{ji}dji​, i.e. a function that solely depends on ddd and not on the angles α\alphaα and φ\varphiφ. We achieve this by setting l=m=0l=m=0l=m=0 and obtain ΨRBF(d)=aj0(z0,ncd)\Psi_{\text{RBF}}(d)=aj_{0}(\frac{z_{0,n}}{c}d)ΨRBF​(d)=aj0​(cz0,n​​d), with roots at z0,n=nπz_{0,n}=n\piz0,n​=nπ. Normalizing this function on [0,c][0,c][0,c] and using j0(d)=sin⁡(d)/dj_{0}(d)=\sin(d)/dj0​(d)=sin(d)/d gives the radial basis e~RBF∈RNRBF\tilde{{\bm{e}}}_{\text{RBF}}\in\mathbb{R}^{N_{\text{RBF}}}e~RBF​∈RNRBF​, as shown in Fig. 3 and defined by

其中 l∈[0..NSHBF−1]l\in[0\mathinner{\ldotp\ldotp}N_{\text{SHBF}}-1]l∈[0..NSHBF​−1],n∈[1..NSRBF]n\in[1\mathinner{\ldotp\ldotp}N_{\text{SRBF}}]n∈[1..NSRBF​]。第二个目标是为 djid_{ji}dji​ 构造径向基,即只依赖 ddd、不依赖角度 α\alphaα 与 φ\varphiφ 的函数。令 l=m=0l=m=0l=m=0,得到 ΨRBF(d)=aj0(z0,ncd)\Psi_{\text{RBF}}(d)=aj_{0}(\frac{z_{0,n}}{c}d)ΨRBF​(d)=aj0​(cz0,n​​d),根在 z0,n=nπz_{0,n}=n\piz0,n​=nπ。在 [0,c][0,c][0,c] 上归一化该函数,并用 j0(d)=sin⁡(d)/dj_{0}(d)=\sin(d)/dj0​(d)=sin(d)/d,得到径向基 e~RBF∈RNRBF\tilde{{\bm{e}}}_{\text{RBF}}\in\mathbb{R}^{N_{\text{RBF}}}e~RBF​∈RNRBF​,如图 3 所示,定义为

e~RBF,n(d)=2csin⁡(nπcd)d,(7)\tilde{e}_{\text{RBF},n}(d)=\sqrt{\frac{2}{c}}\frac{\sin(\frac{n\pi}{c}d)}{d}, \tag{7}e~RBF,n​(d)=c2​​dsin(cnπ​d)​,(7)

with n∈[1..NRBF]n\in[1\mathinner{\ldotp\ldotp}N_{\text{RBF}}]n∈[1..NRBF​]. Both of these bases are purely real-valued and orthogonal in the domain of interest. They furthermore enable us to bound the highest-frequency components by ωα≤NSHBF2π\omega_{\alpha}\leq\frac{N_{\text{SHBF}}}{2\pi}ωα​≤2πNSHBF​​, ωdkj≤NSRBFc\omega_{d_{kj}}\leq\frac{N_{\text{SRBF}}}{c}ωdkj​​≤cNSRBF​​, and ωdji≤NRBFc\omega_{d_{ji}}\leq\frac{N_{\text{RBF}}}{c}ωdji​​≤cNRBF​​. This restriction is an effective way of regularizing the model and ensures that predictions are stable to small perturbations. We found NSRBF=6N_{\text{SRBF}}=6NSRBF​=6 and NRBF=16N_{\text{RBF}}=16NRBF​=16 radial basis functions to be more than sufficient. Note that NRBFN_{\text{RBF}}NRBF​ is 4x lower than PhysNet’s 64 (Unke & Meuwly, 2019) and 20x lower than SchNet’s 300 radial basis functions (Schütt et al., 2017).

其中 n∈[1..NRBF]n\in[1\mathinner{\ldotp\ldotp}N_{\text{RBF}}]n∈[1..NRBF​]。这两种基在感兴趣域上均为纯实值且正交。它们还使我们能把最高频分量界住:ωα≤NSHBF2π\omega_{\alpha}\leq\frac{N_{\text{SHBF}}}{2\pi}ωα​≤2πNSHBF​​,ωdkj≤NSRBFc\omega_{d_{kj}}\leq\frac{N_{\text{SRBF}}}{c}ωdkj​​≤cNSRBF​​,ωdji≤NRBFc\omega_{d_{ji}}\leq\frac{N_{\text{RBF}}}{c}ωdji​​≤cNRBF​​。该限制是正则化模型的有效方式,并确保预测对小扰动稳定。我们发现 NSRBF=6N_{\text{SRBF}}=6NSRBF​=6 与 NRBF=16N_{\text{RBF}}=16NRBF​=16 个径向基函数已绰绰有余。注意 NRBFN_{\text{RBF}}NRBF​ 比 PhysNet 的 64(Unke & Meuwly, 2019)低 4 倍,比 SchNet 的 300 个径向基函数(Schütt et al., 2017)低 20 倍。

Continuous cutoff. a~SBF(kj,ji)\tilde{{\bm{a}}}_{\text{SBF}}^{(kj,ji)}a~SBF(kj,ji)​ and e~RBF(d)\tilde{{\bm{e}}}_{\text{RBF}}(d)e~RBF​(d) are not twice continuously differentiable due to the step function cutoff at ccc. To alleviate this problem we introduce an envelope function u(d)u(d)u(d) that has a root of multiplicity 3 at d=cd=cd=c, causing the final functions aRBF(d)=u(d)a~RBF(d){\bm{a}}_{\text{RBF}}(d)=u(d)\tilde{{\bm{a}}}_{\text{RBF}}(d)aRBF​(d)=u(d)a~RBF​(d) and eRBF(d)=u(d)e~RBF(d){\bm{e}}_{\text{RBF}}(d)=u(d)\tilde{{\bm{e}}}_{\text{RBF}}(d)eRBF​(d)=u(d)e~RBF​(d) and their first and second derivatives to go to 0 at the cutoff. We achieve this with the polynomial

连续截断。 由于在 ccc 处的阶跃截断,a~SBF(kj,ji)\tilde{{\bm{a}}}_{\text{SBF}}^{(kj,ji)}a~SBF(kj,ji)​ 与 e~RBF(d)\tilde{{\bm{e}}}_{\text{RBF}}(d)e~RBF​(d) 并非二阶连续可微。为缓解该问题,我们引入包络函数 u(d)u(d)u(d),它在 d=cd=cd=c 有三重根,从而使最终函数 aRBF(d)=u(d)a~RBF(d){\bm{a}}_{\text{RBF}}(d)=u(d)\tilde{{\bm{a}}}_{\text{RBF}}(d)aRBF​(d)=u(d)a~RBF​(d) 与 eRBF(d)=u(d)e~RBF(d){\bm{e}}_{\text{RBF}}(d)=u(d)\tilde{{\bm{e}}}_{\text{RBF}}(d)eRBF​(d)=u(d)e~RBF​(d) 及其一阶、二阶导数在截断处趋于 0。我们用多项式实现这一点

u(d)=1−(p+1)(p+2)2dp+p(p+2)dp+1−p(p+1)2dp+2,(8)u(d)=1-\frac{(p+1)(p+2)}{2}d^{p}+p(p+2)d^{p+1}-\frac{p(p+1)}{2}d^{p+2}, \tag{8}u(d)=1−2(p+1)(p+2)​dp+p(p+2)dp+1−2p(p+1)​dp+2,(8)

where p∈N0p\in{\mathbb{N}}_{0}p∈N0​. We did not find the model to be sensitive to different choices of envelope functions and choose p=6p=6p=6. Note that using an envelope function causes the bases to lose their orthonormality, which we did not find to be a problem in practice. We furthermore fine-tune the Bessel wave numbers kn=nπck_{n}=\frac{n\pi}{c}kn​=cnπ​ used in e~RBF∈RNRBF\tilde{{\bm{e}}}_{\text{RBF}}\in\mathbb{R}^{N_{\text{RBF}}}e~RBF​∈RNRBF​ via backpropagation after initializing them to these values, which we found to give a small boost in prediction accuracy.

其中 p∈N0p\in{\mathbb{N}}_{0}p∈N0​。我们未发现模型对不同包络函数选择敏感,取 p=6p=6p=6。注意使用包络函数会使基失去标准正交性,实践中我们未发现这成问题。此外,在把 e~RBF∈RNRBF\tilde{{\bm{e}}}_{\text{RBF}}\in\mathbb{R}^{N_{\text{RBF}}}e~RBF​∈RNRBF​ 中使用的贝塞尔波数 kn=nπck_{n}=\frac{n\pi}{c}kn​=cnπ​ 初始化为这些值后,我们再经反向传播微调,发现可小幅提升预测精度。

6 Directional Message Passing Neural Network (DimeNet)

6 有向消息传递神经网络(DimeNet)

Figure 4

Figure 4: The DimeNet architecture. □\square□ denotes the layer’s input and ∥\|∥ denotes concatenation. The distances djid_{ji}dji​ are represented using spherical Bessel functions and the distances dkjd_{kj}dkj​ and angles α(kj,ji)\alpha_{(kj,ji)}α(kj,ji)​ are jointly represented using a 2D spherical Fourier-Bessel basis. An embedding block generates the inital message embeddings mji{\bm{m}}_{ji}mji​. These embeddings are updated in multiple interaction blocks via directional message passing, which uses the neighboring messages mkj,k∈Nj∖{i}{\bm{m}}_{kj},k\in\mathcal{N}_{j}\setminus\{i\}mkj​,k∈Nj​∖{i}, the 2D representations aSBF(kj,ji){\bm{a}}_{\text{SBF}}^{(kj,ji)}aSBF(kj,ji)​, and the distance representations eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​. Each block passes the resulting embeddings to an output block, which transforms them using the radial basis eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​ and sums them up per atom. Finally, the outputs of all layers are summed up to generate the prediction.

图 4:DimeNet 架构。□\square□ 表示层的输入,∥\|∥ 表示拼接。距离 djid_{ji}dji​ 用球贝塞尔函数表示;距离 dkjd_{kj}dkj​ 与夹角 α(kj,ji)\alpha_{(kj,ji)}α(kj,ji)​ 用二维球面傅里叶–贝塞尔基联合表示。嵌入块生成初始消息嵌入 mji{\bm{m}}_{ji}mji​。这些嵌入在多个相互作用块中经有向消息传递更新,使用邻近消息 mkj,k∈Nj∖{i}{\bm{m}}_{kj},k\in\mathcal{N}_{j}\setminus\{i\}mkj​,k∈Nj​∖{i}、二维表示 aSBF(kj,ji){\bm{a}}_{\text{SBF}}^{(kj,ji)}aSBF(kj,ji)​ 与距离表示 eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​。每个块把所得嵌入传给输出块,输出块用径向基 eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​ 变换后按原子求和。最后把所有层的输出相加得到预测。

The Directional Message Passing Neural Network’s (DimeNet) design is based on a streamlined version of the PhysNet architecture (Unke & Meuwly, 2019), in which we have integrated directional message passing and spherical Fourier-Bessel representations. DimeNet generates predictions that are invariant to atom permutations and translation, rotation and inversion of the molecule. DimeNet is suitable both for the prediction of various molecular properties and for molecular dynamics (MD) simulations. It is twice continuously differentiable and able to learn and predict atomic forces via backpropagation, as described in Sec. 3. The predicted forces fulfill energy conservation by construction and are equivariant with respect to permutation and rotation. Model differentiability in combination with basis representations that have bounded maximum frequencies furthermore guarantees smooth predictions that are stable to small deformations. Fig. 4 gives an overview of the architecture.

有向消息传递神经网络(DimeNet)的设计基于精简版 PhysNet 架构(Unke & Meuwly, 2019),其中我们整合了有向消息传递与球面傅里叶–贝塞尔表示。DimeNet 产生的预测对原子置换以及分子的平移、旋转与反演不变。它既适用于多种分子性质预测,也适用于分子动力学(MD)模拟。它二阶连续可微,并能如第 3 节所述经反向传播学习并预测原子力。预测的力由构造满足能量守恒,并对置换与旋转等变。模型可微性与最高频率有界的基表示相结合,还保证预测平滑、对小形变稳定。图 4 给出架构概览。

Embedding block. Atomic numbers are represented by learnable, randomly initialized atom type embeddings hi(0)∈RF{\bm{h}}_{i}^{(0)}\in\mathbb{R}^{F}hi(0)​∈RF that are shared across molecules. The first layer generates message embeddings from these and the distance between atoms via

嵌入块。 原子序数由可学习、随机初始化、跨分子共享的原子类型嵌入 hi(0)∈RF{\bm{h}}_{i}^{(0)}\in\mathbb{R}^{F}hi(0)​∈RF 表示。第一层由这些嵌入与原子间距离生成消息嵌入:

mji(1)=σ([hj(0)∥hi(0)∥eRBF(ji)]W+b),(9){\bm{m}}_{ji}^{(1)}=\sigma([{\bm{h}}_{j}^{(0)}\|{\bm{h}}_{i}^{(0)}\|{\bm{e}}_{\text{RBF}}^{(ji)}]{\bm{W}}+{\bm{b}}), \tag{9}mji(1)​=σ([hj(0)​∥hi(0)​∥eRBF(ji)​]W+b),(9)

where ∥\|∥ denotes concatenation and the weight matrix W{\bm{W}}W and bias b{\bm{b}}b are learnable.

其中 ∥\|∥ 表示拼接,权重矩阵 W{\bm{W}}W 与偏置 b{\bm{b}}b 可学习。

Interaction block. The embedding block is followed by multiple stacked interaction blocks. This block implements fintf_{\text{int}}fint​ and fupdatef_{\text{update}}fupdate​ of Eq. 4 as shown in Fig. 4. Note that the 2D representation aSBF(kj,ji){\bm{a}}_{\text{SBF}}^{(kj,ji)}aSBF(kj,ji)​ is first transformed into an NbilinearN_{\text{bilinear}}Nbilinear​-dimensional representation via a linear layer. The main purpose of this is to make the dimensionality of aSBF(kj,ji){\bm{a}}_{\text{SBF}}^{(kj,ji)}aSBF(kj,ji)​ independent of the subsequent bilinear layer, which uses a comparatively large Nbilinear×F×FN_{\text{bilinear}}\times F\times FNbilinear​×F×F-dimensional weight tensor. We have also experimented with using a bilinear layer for the radial basis representation, but found that the element-wise multiplication eRBF(ji)W⊙mkj{\bm{e}}_{\text{RBF}}^{(ji)}{\bm{W}}\odot{\bm{m}}_{kj}eRBF(ji)​W⊙mkj​ performs better, which suggests that the 2D representations require more complex transformations than radial information alone. The interaction block transforms each message embedding mji{\bm{m}}_{ji}mji​ using multiple residual blocks, which are inspired by ResNet (He et al., 2016) and consist of two stacked dense layers and a skip connection.

相互作用块。 嵌入块之后是多个堆叠的相互作用块。该块实现式 4 的 fintf_{\text{int}}fint​ 与 fupdatef_{\text{update}}fupdate​,如图 4 所示。注意二维表示 aSBF(kj,ji){\bm{a}}_{\text{SBF}}^{(kj,ji)}aSBF(kj,ji)​ 先经线性层变换为 NbilinearN_{\text{bilinear}}Nbilinear​ 维表示。主要目的是使 aSBF(kj,ji){\bm{a}}_{\text{SBF}}^{(kj,ji)}aSBF(kj,ji)​ 的维数独立于后续双线性层,后者使用相对较大的 Nbilinear×F×FN_{\text{bilinear}}\times F\times FNbilinear​×F×F 维权重张量。我们也尝试过对径向基表示使用双线性层,但发现逐元素乘法 eRBF(ji)W⊙mkj{\bm{e}}_{\text{RBF}}^{(ji)}{\bm{W}}\odot{\bm{m}}_{kj}eRBF(ji)​W⊙mkj​ 表现更好,这表明二维表示需要比仅径向信息更复杂的变换。相互作用块用多个残差块变换每个消息嵌入 mji{\bm{m}}_{ji}mji​;残差块受 ResNet(He et al., 2016)启发,由两个堆叠稠密层与一条跳跃连接组成。

Output block. The message embeddings after each block (including the embedding block) are passed to an output block. The output block transforms each message embedding mji{\bm{m}}_{ji}mji​ using the radial basis eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​, which ensures continuous differentiability and slightly improves performance. Afterwards the incoming messages are summed up per atom iii to obtain hi=∑jmji{\bm{h}}_{i}=\sum_{j}{\bm{m}}_{ji}hi​=∑j​mji​, which is then transformed using multiple dense layers to generate the atom-wise output ti(l)t_{i}^{(l)}ti(l)​. These outputs are then summed up to obtain the final prediction t=∑i∑lti(l)t=\sum_{i}\sum_{l}t_{i}^{(l)}t=∑i​∑l​ti(l)​.

输出块。 每个块(含嵌入块)之后的消息嵌入被送入输出块。输出块用径向基 eRBF(ji){\bm{e}}_{\text{RBF}}^{(ji)}eRBF(ji)​ 变换每个消息嵌入 mji{\bm{m}}_{ji}mji​,这保证连续可微并略微提升表现。随后按原子 iii 对传入消息求和得到 hi=∑jmji{\bm{h}}_{i}=\sum_{j}{\bm{m}}_{ji}hi​=∑j​mji​,再经多个稠密层变换生成原子级输出 ti(l)t_{i}^{(l)}ti(l)​。这些输出再相加得到最终预测 t=∑i∑lti(l)t=\sum_{i}\sum_{l}t_{i}^{(l)}t=∑i​∑l​ti(l)​。

Continuous differentiability. Multiple model choices were necessary to achieve twice continuous model differentiability. First, DimeNet uses the self-gated Swish activation function σ(x)=x⋅sigmoid(x)\sigma(x)=x\cdot\text{sigmoid}(x)σ(x)=x⋅sigmoid(x) (Ramachandran et al., 2018) instead of a regular ReLU activation function. Second, we multiply the radial basis functions e~RBF(d)\tilde{{\bm{e}}}_{\text{RBF}}(d)e~RBF​(d) with an envelope function u(d)u(d)u(d) that has a root of multiplicity 3 at the cutoff ccc. Finally, DimeNet does not use any auxiliary data but relies on atom types and positions alone.

连续可微性。 为实现二阶连续可微,做了多项模型选择。第一,DimeNet 使用自门控 Swish 激活 σ(x)=x⋅sigmoid(x)\sigma(x)=x\cdot\text{sigmoid}(x)σ(x)=x⋅sigmoid(x)(Ramachandran et al., 2018),而非常规 ReLU。第二,我们把径向基函数 e~RBF(d)\tilde{{\bm{e}}}_{\text{RBF}}(d)e~RBF​(d) 乘以在截断 ccc 有三重根的包络函数 u(d)u(d)u(d)。最后,DimeNet 不使用任何辅助数据,仅依赖原子类型与位置。

7 Experiments

7 实验

Models. For hyperparameter choices and training setup see Appendix B. We use 6 state-of-the-art models for comparison: SchNet (Schütt et al., 2017), PhysNet (results based on the reference implementation) (Unke & Meuwly, 2019), provably powerful graph networks (PPGN, results provided by the original authors) (Maron et al., 2019), MEGNet-simple (without auxiliary information) (Chen et al., 2019a), Cormorant (Anderson et al., 2019), and symmetrized gradient-domain machine learning (sGDML) (Chmiela et al., 2018). Note that sGDML cannot be used for QM9 since it can only be trained on a single molecule.

模型。 超参选择与训练设置见附录 B。我们用 6 个当时最优模型作比较:SchNet(Schütt et al., 2017)、PhysNet(结果基于参考实现)(Unke & Meuwly, 2019)、可证强大的图网络(PPGN,结果由原作者提供)(Maron et al., 2019)、MEGNet-simple(无辅助信息)(Chen et al., 2019a)、Cormorant(Anderson et al., 2019),以及对称化梯度域机器学习(sGDML)(Chmiela et al., 2018)。注意 sGDML 不能用于 QM9,因为它只能在单个分子上训练。

Target Unit PPGN SchNet PhysNet MEGNet-s Cormorant DimeNet
μ\muμ D\mathrm{D}D 0.0470.0470.047 0.0330.0330.033 0.05290.05290.0529 0.050.050.05 0.130.130.13 0.02860.02860.0286
α\alphaα a\mathrm{a}a 0.1310.1310.131 0.2350.2350.235 0.06150.06150.0615 0.0810.0810.081 0.0920.0920.092 0.04690.04690.0469
ϵHOMO\epsilon_{\text{HOMO}}ϵHOMO​ meV\mathrm{meV}meV 40.340.340.3 414141 32.932.932.9 434343 363636 27.827.827.8
ϵLUMO\epsilon_{\text{LUMO}}ϵLUMO​ meV\mathrm{meV}meV 32.732.732.7 343434 24.724.724.7 444444 363636 19.719.719.7
Δϵ\Delta\epsilonΔϵ meV\mathrm{meV}meV 60.060.060.0 636363 42.542.542.5 666666 606060 34.834.834.8
<R2>\left<R^{2}\right>⟨R2⟩ a\mathrm{a}a 0.5920.5920.592 0.0730.0730.073 0.7650.7650.765 0.3020.3020.302 0.6730.6730.673 0.3310.3310.331
ZPVE meV\mathrm{meV}meV 3.123.123.12 1.71.71.7 1.391.391.39 1.431.431.43 1.981.981.98 1.291.291.29
U0U_{0}U0​ meV\mathrm{meV}meV 36.836.836.8 141414 8.158.158.15 121212 282828 8.028.028.02
UUU meV\mathrm{meV}meV 36.836.836.8 191919 8.348.348.34 131313 - 7.897.897.89
HHH meV\mathrm{meV}meV 36.336.336.3 141414 8.428.428.42 121212 - 8.118.118.11
GGG meV\mathrm{meV}meV 36.436.436.4 141414 9.409.409.40 121212 - 8.988.988.98
cvc_{\text{v}}cv​ calmol K\frac{\mathrm{cal}}{\mathrm{mol}\text{\,}\mathrm{K}}molKcal​ 0.0550.0550.055 0.0330.0330.033 0.02800.02800.0280 0.0290.0290.029 0.0310.0310.031 0.02490.02490.0249
std. MAE %\mathrm{\%}% 1.841.841.84 1.761.761.76 1.371.371.37 1.801.801.80 2.142.142.14 1.051.051.05
logMAE - −4.64-4.64−4.64 −5.17-5.17−5.17 −5.35-5.35−5.35 −5.17-5.17−5.17 −4.75-4.75−4.75 −5.57-5.57−5.57

Table 1: MAE on QM9. DimeNet sets the state of the art on 11 targets, outperforming the second-best model on average by 31 %31\text{\,}\mathrm{\%}31% (mean std. MAE).

Target Unit PPGN SchNet PhysNet MEGNet-s Cormorant DimeNet
μ\muμ D\mathrm{D}D 0.0470.0470.047 0.0330.0330.033 0.05290.05290.0529 0.050.050.05 0.130.130.13 0.02860.02860.0286
α\alphaα a\mathrm{a}a 0.1310.1310.131 0.2350.2350.235 0.06150.06150.0615 0.0810.0810.081 0.0920.0920.092 0.04690.04690.0469
ϵHOMO\epsilon_{\text{HOMO}}ϵHOMO​ meV\mathrm{meV}meV 40.340.340.3 414141 32.932.932.9 434343 363636 27.827.827.8
ϵLUMO\epsilon_{\text{LUMO}}ϵLUMO​ meV\mathrm{meV}meV 32.732.732.7 343434 24.724.724.7 444444 363636 19.719.719.7
Δϵ\Delta\epsilonΔϵ meV\mathrm{meV}meV 60.060.060.0 636363 42.542.542.5 666666 606060 34.834.834.8
<R2>\left<R^{2}\right>⟨R2⟩ a\mathrm{a}a 0.5920.5920.592 0.0730.0730.073 0.7650.7650.765 0.3020.3020.302 0.6730.6730.673 0.3310.3310.331
ZPVE meV\mathrm{meV}meV 3.123.123.12 1.71.71.7 1.391.391.39 1.431.431.43 1.981.981.98 1.291.291.29
U0U_{0}U0​ meV\mathrm{meV}meV 36.836.836.8 141414 8.158.158.15 121212 282828 8.028.028.02
UUU meV\mathrm{meV}meV 36.836.836.8 191919 8.348.348.34 131313 - 7.897.897.89
HHH meV\mathrm{meV}meV 36.336.336.3 141414 8.428.428.42 121212 - 8.118.118.11
GGG meV\mathrm{meV}meV 36.436.436.4 141414 9.409.409.40 121212 - 8.988.988.98
cvc_{\text{v}}cv​ calmol K\frac{\mathrm{cal}}{\mathrm{mol}\text{\,}\mathrm{K}}molKcal​ 0.0550.0550.055 0.0330.0330.033 0.02800.02800.0280 0.0290.0290.029 0.0310.0310.031 0.02490.02490.0249
std. MAE %\mathrm{\%}% 1.841.841.84 1.761.761.76 1.371.371.37 1.801.801.80 2.142.142.14 1.051.051.05
logMAE - −4.64-4.64−4.64 −5.17-5.17−5.17 −5.35-5.35−5.35 −5.17-5.17−5.17 −4.75-4.75−4.75 −5.57-5.57−5.57

表 1:QM9 上的 MAE。DimeNet 在 11 个目标上刷新当时最优,平均 std. MAE 优于次优模型 31 %31\text{\,}\mathrm{\%}31%。

QM9. We test DimeNet’s performance for predicting molecular properties using the common QM9 benchmark (Ramakrishnan et al., 2014). It consists of roughly 130 000130\,000130000 molecules in equilibrium with up to 9 heavy C, O, N, and F atoms. We use 110 000110\,000110000 molecules in the training, 10 00010\,00010000 in the validation and 10 83110\,83110831 in the test set. We only use the atomization energy for U0U_{0}U0​, UUU, HHH, and GGG, i.e. subtract the atomic reference energies, which are constant per atom type, and perform the training using eV\mathrm{eV}eV. In Table 1 we report the mean absolute error (MAE) of each target and the overall mean standardized MAE (std. MAE) and mean standardized logMAE (for details see Appendix C). We predict Δϵ\Delta\epsilonΔϵ simply by taking ϵLUMO−ϵHOMO\epsilon_{\text{LUMO}}-\epsilon_{\text{HOMO}}ϵLUMO​−ϵHOMO​, since it is calculated in exactly this way by DFT calculations. We train a separate model for each target, which significantly improves results compared to training a single shared model for all targets (see App. E). DimeNet sets the new state of the art on 11 out of 12 targets and decreases mean std. MAE by 31 %31\text{\,}\mathrm{\%}31% and mean logMAE by 0.220.220.22 compared to the second-best model.

QM9。 我们用常见的 QM9 基准(Ramakrishnan et al., 2014)测试 DimeNet 预测分子性质的表现。它包含约 130 000130\,000130000 个平衡态分子,最多 9 个重原子 C、O、N、F。我们用 110 000110\,000110000 个分子训练、10 00010\,00010000 验证、10 83110\,83110831 测试。对 U0U_{0}U0​、UUU、HHH 与 GGG 我们只用原子化能,即减去按原子类型恒定的原子参考能量,并以 eV\mathrm{eV}eV 训练。表 1 报告各目标平均绝对误差(MAE),以及总体平均标准化 MAE(std. MAE)与平均标准化 logMAE(细节见附录 C)。我们简单用 ϵLUMO−ϵHOMO\epsilon_{\text{LUMO}}-\epsilon_{\text{HOMO}}ϵLUMO​−ϵHOMO​ 预测 Δϵ\Delta\epsilonΔϵ,因为 DFT 计算正是如此得到它。我们为每个目标训练单独模型,相对为全部目标训练单一共享模型显著提升结果(见附录 E)。DimeNet 在 12 个目标中的 11 个上刷新当时最优,相对次优模型把平均 std. MAE 降低 31 %31\text{\,}\mathrm{\%}31%、平均 logMAE 降低 0.220.220.22。

sGDML SchNet DimeNet
Aspirin Energy 0.190.190.19 0.370.370.37 0.2040.2040.204
Forces 0.680.680.68 1.351.351.35 0.4990.4990.499
Benzene Energy 0.100.100.10 0.080.080.08 0.0780.0780.078
Forces 0.060.060.06 0.310.310.31 0.1870.1870.187
Ethanol Energy 0.070.070.07 0.080.080.08 0.0640.0640.064
Forces 0.330.330.33 0.390.390.39 0.2300.2300.230
Malonaldehyde Energy 0.100.100.10 0.130.130.13 0.1040.1040.104
Forces 0.410.410.41 0.660.660.66 0.3830.3830.383
Naphthalene Energy 0.120.120.12 0.160.160.16 0.1220.1220.122
Forces 0.110.110.11 0.580.580.58 0.2150.2150.215
Salicylic acid Energy 0.120.120.12 0.200.200.20 0.1340.1340.134
Forces 0.280.280.28 0.850.850.85 0.3740.3740.374
Toluene Energy 0.100.100.10 0.120.120.12 0.1020.1020.102
Forces 0.140.140.14 0.570.570.57 0.2160.2160.216
Uracil Energy 0.110.110.11 0.140.140.14 0.1150.1150.115
Forces 0.240.240.24 0.560.560.56 0.3010.3010.301
std. MAE (%\mathrm{\%}%) Energy 2.532.532.53 3.323.323.32 2.492.492.49
Forces 1.011.011.01 2.382.382.38 1.101.101.10
Variation MAEMAE DimeNet\frac{\text{MAE}}{\text{MAE DimeNet}}MAE DimeNetMAE​ Δ\DeltaΔlogMAE
Gaussian RBF 110 %110\text{\,}\mathrm{\%}110% 0.100.100.10
NSHBF=1N_{\text{SHBF}}=1NSHBF​=1 126 %126\text{\,}\mathrm{\%}126% 0.110.110.11
Node embeddings 168 %168\text{\,}\mathrm{\%}168% 0.450.450.45

Figure 5: MAE on MD17 using 100010001000 training samples (energies in kcalmol\frac{\mathrm{kcal}}{\mathrm{mol}}molkcal​, forces in kcalmol \SIUnitSymbolAngstrom\frac{\mathrm{kcal}}{\mathrm{mol}\text{\,}\mathrm{\SIUnitSymbolAngstrom}}mol\SIUnitSymbolAngstromkcal​). DimeNet outperforms SchNet by a large margin and performs roughly on par with sGDML.

sGDML SchNet DimeNet
Aspirin Energy 0.190.190.19 0.370.370.37 0.2040.2040.204
Forces 0.680.680.68 1.351.351.35 0.4990.4990.499
Benzene Energy 0.100.100.10 0.080.080.08 0.0780.0780.078
Forces 0.060.060.06 0.310.310.31 0.1870.1870.187
Ethanol Energy 0.070.070.07 0.080.080.08 0.0640.0640.064
Forces 0.330.330.33 0.390.390.39 0.2300.2300.230
Malonaldehyde Energy 0.100.100.10 0.130.130.13 0.1040.1040.104
Forces 0.410.410.41 0.660.660.66 0.3830.3830.383
Naphthalene Energy 0.120.120.12 0.160.160.16 0.1220.1220.122
Forces 0.110.110.11 0.580.580.58 0.2150.2150.215
Salicylic acid Energy 0.120.120.12 0.200.200.20 0.1340.1340.134
Forces 0.280.280.28 0.850.850.85 0.3740.3740.374
Toluene Energy 0.100.100.10 0.120.120.12 0.1020.1020.102
Forces 0.140.140.14 0.570.570.57 0.2160.2160.216
Uracil Energy 0.110.110.11 0.140.140.14 0.1150.1150.115
Forces 0.240.240.24 0.560.560.56 0.3010.3010.301
std. MAE (%\mathrm{\%}%) Energy 2.532.532.53 3.323.323.32 2.492.492.49
Forces 1.011.011.01 2.382.382.38 1.101.101.10
Variation MAEMAE DimeNet\frac{\text{MAE}}{\text{MAE DimeNet}}MAE DimeNetMAE​ Δ\DeltaΔlogMAE
Gaussian RBF 110 %110\text{\,}\mathrm{\%}110% 0.100.100.10
NSHBF=1N_{\text{SHBF}}=1NSHBF​=1 126 %126\text{\,}\mathrm{\%}126% 0.110.110.11
Node embeddings 168 %168\text{\,}\mathrm{\%}168% 0.450.450.45

图 5:MD17 上用 100010001000 个训练样本的 MAE(能量单位 kcalmol\frac{\mathrm{kcal}}{\mathrm{mol}}molkcal​,力单位 kcalmol \SIUnitSymbolAngstrom\frac{\mathrm{kcal}}{\mathrm{mol}\text{\,}\mathrm{\SIUnitSymbolAngstrom}}mol\SIUnitSymbolAngstromkcal​)。DimeNet 大幅超过 SchNet,与 sGDML 大致持平。

MD17. We use MD17 (Chmiela et al., 2017) to test model performance in molecular dynamics simulations. The goal of this benchmark is predicting both the energy and atomic forces of eight small organic molecules, given the atom coordinates of the thermalized (i.e. non-equilibrium, slightly moving) system. The ground truth data is computed via molecular dynamics simulations using DFT. A separate model is trained for each molecule, with the goal of providing highly accurate individual predictions. This dataset is commonly used with 50 00050\,00050000 training and 10 00010\,00010000 validation and test samples. We found that DimeNet can match state-of-the-art performance in this setup. E.g. for Benzene, depending on the force weight ρ\rhoρ, DimeNet achieves 0.035 kcal mol−10.035\text{\,}\mathrm{kcal}\text{\,}{\mathrm{mol}}^{-1}0.035kcalmol−1 MAE for the energy or 0.07 kcal mol−10.07\text{\,}\mathrm{kcal}\text{\,}{\mathrm{mol}}^{-1}0.07kcalmol−1 and 0.17 kcal mol−1 \SIUnitSymbolAngstrom−10.17\text{\,}\mathrm{kcal}\text{\,}{\mathrm{mol}}^{-1}\text{\,}{\mathrm{\SIUnitSymbolAngstrom}}^{-1}0.17kcalmol−1\SIUnitSymbolAngstrom−1 for energy and forces, matching the results reported by Anderson et al. (2019) and Unke & Meuwly (2019). However, this accuracy is two orders of magnitude below the DFT calculation’s accuracy (approx. 2.3 kcal mol−12.3\text{\,}\mathrm{kcal}\text{\,}{\mathrm{mol}}^{-1}2.3kcalmol−1 for energy (Faber et al., 2017)), so any remaining difference to real-world data is almost exclusively due to errors in the DFT simulation. Truly reaching better accuracy can therefore only be achieved with more precise ground-truth data, which requires far more expensive methods (e.g. CCSD(T)) and thus ML models that are more sample-efficient (Chmiela et al., 2018). We therefore instead test our model on the harder task of using only 100010001000 training samples. As shown in Table 7 DimeNet outperforms SchNet by a large margin and performs roughly on par with sGDML. However, sGDML uses hand-engineered descriptors that provide a strong advantage for small datasets, can only be trained on a single molecule (a fixed set of atoms), and does not scale well with the number of atoms or training samples.

MD17。 我们用 MD17(Chmiela et al., 2017)测试分子动力学模拟中的模型表现。该基准目标是:给定热化(即非平衡、轻微运动)系统的原子坐标,预测八种小有机分子的能量与原子力。真实数据由 DFT 分子动力学模拟计算。为每个分子训练单独模型,目标是提供高度精确的个体预测。该数据集通常用 50 00050\,00050000 训练与 10 00010\,00010000 验证与测试样本。我们发现 DimeNet 在此设定可匹配当时最优表现。例如对苯,按力权重 ρ\rhoρ 不同,DimeNet 能量 MAE 可达 0.035 kcal mol−10.035\text{\,}\mathrm{kcal}\text{\,}{\mathrm{mol}}^{-1}0.035kcalmol−1,或能量与力分别为 0.07 kcal mol−10.07\text{\,}\mathrm{kcal}\text{\,}{\mathrm{mol}}^{-1}0.07kcalmol−1 与 0.17 kcal mol−1 \SIUnitSymbolAngstrom−10.17\text{\,}\mathrm{kcal}\text{\,}{\mathrm{mol}}^{-1}\text{\,}{\mathrm{\SIUnitSymbolAngstrom}}^{-1}0.17kcalmol−1\SIUnitSymbolAngstrom−1,匹配 Anderson et al. (2019) 与 Unke & Meuwly (2019) 报告的结果。但该精度比 DFT 计算精度(能量约 2.3 kcal mol−12.3\text{\,}\mathrm{kcal}\text{\,}{\mathrm{mol}}^{-1}2.3kcalmol−1(Faber et al., 2017))低两个数量级,因而与真实世界数据的剩余差距几乎完全来自 DFT 模拟误差。真正达到更高精度因此只能依赖更精确的真实数据,这需要远更昂贵的方法(如 CCSD(T)),从而也需要更样本高效的机器学习模型(Chmiela et al., 2018)。因此我们改为在更难的设定上测试:仅用 100010001000 个训练样本。如表 7 所示,DimeNet 大幅超过 SchNet,与 sGDML 大致持平。但 sGDML 使用手工描述符,在小数据上优势明显,只能在单个分子(固定原子集)上训练,且随原子数或训练样本量扩展不佳。

Ablation studies. To test whether directional message passing and the Fourier-Bessel basis are the actual reason for DimeNet’s improved performance, we ablate them individually and compare the mean standardized MAE and logMAE for multi-task learning on QM9. Table 7 shows that both of our contributions have a significant impact on the model’s performance. Using 64 Gaussian RBFs instead of 16 and 6 Bessel basis functions to represent djid_{ji}dji​ and dkjd_{kj}dkj​ increases the error by 10 %10\text{\,}\mathrm{\%}10%, which shows that this basis does not only reduce the number of parameters but additionally provides a helpful inductive bias. DimeNet’s error increases by around 26 %26\text{\,}\mathrm{\%}26% when we ignore the angles between messages by setting NSHBF=1N_{\text{SHBF}}=1NSHBF​=1, showing that directly incorporating directional information does indeed improve performance. Using node embeddings instead of message embeddings (and hence also ignoring directional information) has the largest impact and increases MAE by 68 %68\text{\,}\mathrm{\%}68%, at which point DimeNet performs worse than SchNet. Furthermore, Fig. 7 shows that the filters exhibit a structurally meaningful dependence on both the distance and angle. For example, some of these filters are clearly being activated by benzene rings (120 \SIUnitSymbolDegree120\text{\,}\mathrm{\SIUnitSymbolDegree}120\SIUnitSymbolDegree angle, 1.39 \SIUnitSymbolAngstrom1.39\text{\,}\mathrm{\SIUnitSymbolAngstrom}1.39\SIUnitSymbolAngstrom distance). This further demonstrates that the model learns to leverage directional information.

消融研究。 为检验有向消息传递与傅里叶–贝塞尔基是否确为 DimeNet 提升表现,我们分别消融二者,并比较 QM9 多任务学习上的平均标准化 MAE 与 logMAE。表 7 表明,两项贡献都对模型表现有显著影响。用 64 个高斯 RBF 替代 16 与 6 个贝塞尔基函数表示 djid_{ji}dji​ 与 dkjd_{kj}dkj​,误差增加 10 %10\text{\,}\mathrm{\%}10%,说明该基不仅减少参数,还提供有益归纳偏置。令 NSHBF=1N_{\text{SHBF}}=1NSHBF​=1 忽略消息间夹角时,DimeNet 误差约增 26 %26\text{\,}\mathrm{\%}26%,表明直接纳入方向信息确实有益。用节点嵌入替代消息嵌入(因而也忽略方向信息)影响最大,MAE 增加 68 %68\text{\,}\mathrm{\%}68%,此时 DimeNet 落后于 SchNet。此外图 7 表明滤波器对距离与角度都呈现结构上有意义的依赖。例如,其中一些滤波器明显被苯环激活(120 \SIUnitSymbolDegree120\text{\,}\mathrm{\SIUnitSymbolDegree}120\SIUnitSymbolDegree 角、1.39 \SIUnitSymbolAngstrom1.39\text{\,}\mathrm{\SIUnitSymbolAngstrom}1.39\SIUnitSymbolAngstrom 距离)。这进一步说明模型学会了利用方向信息。

8 Conclusion

8 结论

In this work we have introduced directional message passing, a more powerful and expressive interaction scheme for molecular predictions. Directional message passing enables graph neural networks to leverage directional information in addition to the interatomic distances that are used by normal GNNs. We have shown that interatomic distances can be represented in a principled and effective manner using spherical Bessel functions. We have furthermore shown that this representation can be extended to directional information by leveraging 2D spherical Fourier-Bessel basis functions. We have leveraged these innovations to construct DimeNet, a GNN suitable both for predicting molecular properties and for use in molecular dynamics simulations. We have demonstrated DimeNet’s performance on QM9 and MD17 and shown that our contributions are the essential ingredients that enable DimeNet’s state-of-the-art performance. DimeNet directly models the first two terms in Eq. 1, which are known as the important “hard” degrees of freedom in molecules (Leach, 2001). Future work should aim at also incorporating the third and fourth terms of this equation. This could improve predictions even further and enable the application to molecules much larger than those used in common benchmarks like QM9.

本文引入有向消息传递——一种对分子预测更强、更具表达力的相互作用方案。有向消息传递使图神经网络除常规 GNN 使用的原子间距离外,还能利用方向信息。我们表明可用球贝塞尔函数有原则且有效地表示原子间距离;并表明借助二维球面傅里叶–贝塞尔基函数,该表示可扩展到方向信息。我们把这些创新整合为 DimeNet——既适用于预测分子性质、也适用于分子动力学模拟的 GNN。我们在 QM9 与 MD17 上展示了 DimeNet 的表现,并表明这些贡献是支撑其当时最优表现的关键要素。DimeNet 直接建模式 1 的前两项,即分子中重要的「硬」自由度(Leach, 2001)。未来工作应致力于也纳入该方程的第三、四项。这有望进一步提升预测,并使其能应用于远大于 QM9 等常见基准所用规模的分子。

Acknowledgments

致谢

This research was supported by the German Federal Ministry of Education and Research (BMBF), grant no. 01IS18036B, and by the Deutsche Forschungsgemeinschaft (DFG) through the Emmy Noether grant GU 1409/2-1 and the TUM International Graduate School of Science and Engineering (IGSSE), GSC 81. The authors of this work take full responsibilities for its content.

本研究得到德国联邦教育与研究部(BMBF)资助,编号 01IS18036B;以及德意志研究联合会(DFG)Emmy Noether 资助 GU 1409/2-1 与慕尼黑工业大学国际科学与工程研究生院(IGSSE)GSC 81 的支持。作者对本文内容负全部责任。

References

参考文献

Anderson et al. (2019) Brandon M. Anderson, Truong-Son Hy, and Risi Kondor. Cormorant: Covariant Molecular Neural Networks. In NeurIPS , 2019.

Bartók et al. (2010) Albert P. Bartók, Mike C. Payne, Risi Kondor, and Gábor Csányi. Gaussian Approximation Potentials: The Accuracy of Quantum Mechanics, without the Electrons. Physical Review Letters , 104(13):136403, April 2010.

Bartók et al. (2013) Albert P. Bartók, Risi Kondor, and Gábor Csányi. On representing chemical environments. Physical Review B , 87(18):184115, May 2013.

Bartók et al. (2017) Albert P. Bartók, Sandip De, Carl Poelking, Noam Bernstein, James R. Kermode, Gábor Csányi, and Michele Ceriotti. Machine learning unifies the modeling of materials and molecules. Science Advances , 3(12):e1701816, December 2017.

Baskin et al. (1997) Igor I. Baskin, Vladimir A. Palyulin, and Nikolai S. Zefirov. A Neural Device for Searching Direct Correlations between Structures and Properties of Chemical Compounds. Journal of Chemical Information and Computer Sciences , 37(4):715–721, July 1997.

Behler & Parrinello (2007) Jörg Behler and Michele Parrinello. Generalized Neural-Network Representation of High-Dimensional Potential-Energy Surfaces. Physical Review Letters , 98(14):146401, April 2007.

Chen et al. (2019a) Chi Chen, Weike Ye, Yunxing Zuo, Chen Zheng, and Shyue Ping Ong. Graph Networks as a Universal Machine Learning Framework for Molecules and Crystals. Chemistry of Materials , 31(9):3564–3572, May 2019a.

Chen et al. (2019b) Zhengdao Chen, Lisha Li, and Joan Bruna. Supervised Community Detection with Line Graph Neural Networks. In ICLR , 2019b.

Cheng et al. (2019) Xiuyuan Cheng, Qiang Qiu, A. Robert Calderbank, and Guillermo Sapiro. RotDCF: Decomposition of Convolutional Filters for Rotation-Equivariant Deep Networks. In ICLR , 2019.

Chmiela et al. (2017) Stefan Chmiela, Alexandre Tkatchenko, Huziel E. Sauceda, Igor Poltavsky, Kristof T. Schütt, and Klaus-Robert Müller. Machine learning of accurate energy-conserving molecular force fields. Science Advances , 3(5):e1603015, May 2017.

Chmiela et al. (2018) Stefan Chmiela, Huziel E. Sauceda, Klaus-Robert Müller, and Alexandre Tkatchenko. Towards exact molecular dynamics simulations with machine-learned force fields. Nature Communications , 9(1):1–10, September 2018.

Cohen & Welling (2016) Taco Cohen and Max Welling. Group Equivariant Convolutional Networks. In ICML , 2016.

Cohen et al. (2019) Taco Cohen, Maurice Weiler, Berkay Kicanaoglu, and Max Welling. Gauge Equivariant Convolutional Networks and the Icosahedral CNN. In ICML , 2019.

Cohen & Welling (2017) Taco S. Cohen and Max Welling. Steerable CNNs. In ICLR , 2017.

Cohen et al. (2018) Taco S. Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical CNNs. In ICLR , 2018.

Duvenaud et al. (2015) David K. Duvenaud, Dougal Maclaurin, Jorge Aguilera-Iparraguirre, Rafael Gómez-Bombarelli, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P. Adams. Convolutional Networks on Graphs for Learning Molecular Fingerprints. In NIPS , 2015.

Faber et al. (2017) Felix A. Faber, Luke Hutchison, Bing Huang, Justin Gilmer, Samuel S. Schoenholz, George E. Dahl, Oriol Vinyals, Steven Kearnes, Patrick F. Riley, and O. Anatole von Lilienfeld. Machine learning prediction errors better than DFT accuracy. CoRR , 1702.05532, February 2017.

Gasteiger et al. (2019) Johannes Gasteiger, Aleksandar Bojchevski, and Stephan Günnemann. Predict then Propagate: Graph Neural Networks Meet Personalized PageRank. In ICLR , 2019.

Gilmer et al. (2017) Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural Message Passing for Quantum Chemistry. In ICML , 2017.

Gori et al. (2005) M. Gori, G. Monfardini, and F. Scarselli. A new model for learning in graph domains. In IEEE International Joint Conference on Neural Networks , July 2005.

Griffiths & Schroeter (2018) David J. Griffiths and Darrell F. Schroeter. Introduction to Quantum Mechanics . 3 edition, August 2018.

He et al. (2016) Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In CVPR , 2016.

Hy et al. (2018) Truong Son Hy, Shubhendu Trivedi, Horace Pan, Brandon M. Anderson, and Risi Kondor. Predicting molecular properties with covariant compositional networks. The Journal of Chemical Physics , 148(24):241745, June 2018.

Ingraham et al. (2019) John Ingraham, Vikas K. Garg, Regina Barzilay, and Tommi S. Jaakkola. Generative Models for Graph-Based Protein Design. In ICLR workshop , 2019.

Jørgensen et al. (2018) Peter Bjørn Jørgensen, Karsten Wedel Jacobsen, and Mikkel N. Schmidt. Neural Message Passing with Edge Updates for Predicting Properties of Molecules and Materials. CoRR , 1806.03146, 2018.

Kipf & Welling (2017) Thomas N. Kipf and Max Welling. Semi-Supervised Classification with Graph Convolutional Networks. In ICLR , 2017.

Kondor et al. (2018) Risi Kondor, Zhen Lin, and Shubhendu Trivedi. Clebsch-Gordan Nets: a Fully Fourier Space Spherical Convolutional Neural Network. In NeurIPS , 2018.

Leach (2001) Andrew R. Leach. Molecular Modelling: Principles and Applications . 2001.

Maron et al. (2019) Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably Powerful Graph Networks. In NeurIPS , 2019.

Morris et al. (2019) Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and Leman Go Neural: Higher-Order Graph Neural Networks. In AAAI , 2019.

Noether (1918) Emmy Noether. Invariante Variationsprobleme. Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen, Mathematisch-Physikalische Klasse , 1918:235–257, 1918.

Pukrittayakamee et al. (2009) A. Pukrittayakamee, M. Malshe, M. Hagan, L. M. Raff, R. Narulkar, S. Bukkapatnum, and R. Komanduri. Simultaneous fitting of a potential-energy surface and its corresponding force fields using feedforward neural networks. The Journal of Chemical Physics , 130(13):134101, April 2009.

Ramachandran et al. (2018) Prajit Ramachandran, Barret Zoph, and Quoc V. Le. Searching for Activation Functions. In ICLR workshop , 2018.

Ramakrishnan et al. (2014) Raghunathan Ramakrishnan, Pavlo O. Dral, Matthias Rupp, and O. Anatole von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific Data , 1(1):1–7, August 2014.

Ravanbakhsh et al. (2017) Siamak Ravanbakhsh, Jeff G. Schneider, and Barnabás Póczos. Equivariance Through Parameter-Sharing. In ICML , 2017.

Reddi et al. (2018) Sashank J. Reddi, Satyen Kale, and Sanjiv Kumar. On the Convergence of Adam and Beyond. In ICLR , 2018.

Scarselli et al. (2009) F. Scarselli, M. Gori, Ah Chung Tsoi, M. Hagenbuchner, and G. Monfardini. The Graph Neural Network Model. IEEE Transactions on Neural Networks , 20(1):61–80, January 2009.

Schütt et al. (2017) Kristof Schütt, Pieter-Jan Kindermans, Huziel Enoc Sauceda Felix, Stefan Chmiela, Alexandre Tkatchenko, and Klaus-Robert Müller. SchNet: A continuous-filter convolutional neural network for modeling quantum interactions. In NIPS , 2017.

Sperduti & Starita (1997) A. Sperduti and A. Starita. Supervised neural networks for the classification of structures. IEEE Transactions on Neural Networks , 8(3):714–735, May 1997.

Thomas et al. (2018) Nathaniel Thomas, Tess Smidt, Steven M. Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor Field Networks: Rotation- and Translation-Equivariant Neural Networks for 3D Point Clouds. CoRR , 1802.08219, 2018.

Unke & Meuwly (2019) Oliver T. Unke and Markus Meuwly. PhysNet: A Neural Network for Predicting Energies, Forces, Dipole Moments, and Partial Charges. Journal of Chemical Theory and Computation , 15(6):3678–3693, June 2019.

Weiler et al. (2018) Maurice Weiler, Mario Geiger, Max Welling, Wouter Boomsma, and Taco Cohen. 3D Steerable CNNs: Learning Rotationally Equivariant Features in Volumetric Data. In NeurIPS , 2018.

Wu et al. (2018) Zhenqin Wu, Bharath Ramsundar, Evan N. Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S. Pappu, Karl Leswing, and Vijay Pande. MoleculeNet: a benchmark for molecular machine learning. Chemical Science , 9(2):513–530, 2018.

Xu et al. (2019) Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful are Graph Neural Networks? In ICLR , 2019.

Yedidia et al. (2003) Jonathan S Yedidia, William T Freeman, and Yair Weiss. Understanding belief propagation and its generalizations. In Exploring artificial intelligence in the new millennium , volume 8, pp. 236–239. 2003.

Zambaldi et al. (2019) Vinícius Flores Zambaldi, David Raposo, Adam Santoro, Victor Bapst, Yujia Li, Igor Babuschkin, Karl Tuyls, David P. Reichert, Timothy P. Lillicrap, Edward Lockhart, Murray Shanahan, Victoria Langston, Razvan Pascanu, Matthew Botvinick, Oriol Vinyals, and Peter W. Battaglia. Deep reinforcement learning with relational inductive biases. In ICLR , 2019.

Appendix A Indistinguishable molecules

附录 A 不可区分的分子

Figure 8: A standard non-directional GNN cannot distinguish between a hexagonal (left) and two triangular molecules (right) with the same bond lengths, since the neighborhood of each atom is exactly the same. An example of this would be Cyclohexane and two Cyclopropane molecules with slightly stretched bonds, when the GNN either uses the molecular graph or a cutoff distance of c≤c\leqc≤2.5\text{,}\mathrm{\SIUnitSymbolAngstrom}$$. Directional message passing solves this problem by considering the direction of each bond.

图 8:标准无向 GNN 无法区分键长相同的六边形分子(左)与两个三角形分子(右),因为每个原子的邻域完全相同。例如环己烷与两个键略被拉长的环丙烷,当 GNN 使用分子图或截断距离 c≤c\leqc≤2.5\text{,}\mathrm{\SIUnitSymbolAngstrom}$$ 时即如此。有向消息传递通过考虑每条键的方向解决该问题。

Appendix B Experimental setup

附录 B 实验设置

The model architecture and hyperparameters were optimized using the QM9 validation set. We use 6 stacked interaction blocks and embeddings of size F=128F=128F=128 throughout the model. For the basis functions we choose NSHBF=7N_{\text{SHBF}}=7NSHBF​=7 and NSRBF=NRBF=6N_{\text{SRBF}}=N_{\text{RBF}}=6NSRBF​=NRBF​=6. For the weight tensor in the interaction block we use Nbilinear=8N_{\text{bilinear}}=8Nbilinear​=8. We did not find the model to be very sensitive to these values as long as they were large enough (i.e. at least 4).

模型架构与超参在 QM9 验证集上优化。我们使用 6 个堆叠相互作用块,模型全程嵌入大小 F=128F=128F=128。基函数取 NSHBF=7N_{\text{SHBF}}=7NSHBF​=7,NSRBF=NRBF=6N_{\text{SRBF}}=N_{\text{RBF}}=6NSRBF​=NRBF​=6。相互作用块中的权重张量取 Nbilinear=8N_{\text{bilinear}}=8Nbilinear​=8。只要这些值足够大(即至少 4),我们未发现模型对其非常敏感。

We found the cutoff c=c=c=5\text{,}\mathrm{\SIUnitSymbolAngstrom}$$ and the learning rate 1\times10−31\text{\times}{10}^{-3}1\times10−3 to be rather important hyperparameters. We optimized the model using AMSGrad (Reddi et al., 2018) with 32 molecules per mini-batch. We use a linear learning rate warm-up over 300030003000 steps and an exponential decay with ratio 0.10.10.1 every 2 000 0002\,000\,0002000000 steps. The model weights for validation and test were obtained using an exponential moving average (EMA) with decay rate 0.9990.9990.999. For MD17 we use the loss function from Eq. 2 with force weight ρ=100\rho=100ρ=100, like previous models Schütt et al. (2017). Note that ρ\rhoρ presents a trade-off between energy and force accuracy. It should be chosen rather high since the forces determine the dynamics of the chemical system (Unke & Meuwly, 2019). We use early stopping on the validation loss. On QM9 we train for at most 3 000 0003\,000\,0003000000 and on MD17 for at most 100 000100\,000100000 steps.

我们发现截断 c=c=c=5\text{,}\mathrm{\SIUnitSymbolAngstrom}$$ 与学习率 1\times10−31\text{\times}{10}^{-3}1\times10−3 是相当重要的超参。用 AMSGrad(Reddi et al., 2018)优化,每小批量 32 个分子。学习率在 300030003000 步内线性预热,并以每 2 000 0002\,000\,0002000000 步比率 0.10.10.1 指数衰减。验证与测试用的模型权重由衰减率 0.9990.9990.999 的指数滑动平均(EMA)得到。对 MD17 使用式 2 的损失函数,力权重 ρ=100\rho=100ρ=100,与先前模型 Schütt et al. (2017) 一致。注意 ρ\rhoρ 在能量与力精度之间做权衡;由于力决定化学系统动力学,应取得偏高(Unke & Meuwly, 2019)。我们在验证损失上早停。QM9 最多训练 3 000 0003\,000\,0003000000 步,MD17 最多 100 000100\,000100000 步。

Appendix C Summary statistics

附录 C 汇总统计

We summarize the results across different targets using the mean standardized MAE

我们用平均标准化 MAE 汇总不同目标上的结果

std. MAE=1M∑m=1M(1N∑i=1N∣fθ(m)(Xi,zi)−t^i(m)∣σm),(10)\text{std. MAE}=\frac{1}{M}\sum_{m=1}^{M}\left(\frac{1}{N}\sum_{i=1}^{N}\frac{|f_{\theta}^{(m)}({\bm{X}}_{i},{\bm{z}}_{i})-\hat{t}_{i}^{(m)}|}{\sigma_{m}}\right), \tag{10}std. MAE=M1​m=1∑M​(N1​i=1∑N​σm​∣fθ(m)​(Xi​,zi​)−t^i(m)​∣​),(10)

and the mean standardized logMAE

以及平均标准化 logMAE

logMAE=1M∑m=1Mlog⁡(1N∑i=1N∣fθ(m)(Xi,zi)−t^i(m)∣σm),(11)\text{logMAE}=\frac{1}{M}\sum_{m=1}^{M}\log\left(\frac{1}{N}\sum_{i=1}^{N}\frac{|f_{\theta}^{(m)}({\bm{X}}_{i},{\bm{z}}_{i})-\hat{t}_{i}^{(m)}|}{\sigma_{m}}\right), \tag{11}logMAE=M1​m=1∑M​log(N1​i=1∑N​σm​∣fθ(m)​(Xi​,zi​)−t^i(m)​∣​),(11)

with target index mmm, number of targets M=12M=12M=12, dataset size NNN, ground truth values t^(m)\hat{{\bm{t}}}^{(m)}t^(m), model fθ(m)f_{\theta}^{(m)}fθ(m)​, inputs Xi{\bm{X}}_{i}Xi​ and zi{\bm{z}}_{i}zi​, and standard deviation σm\sigma_{m}σm​ of t^(m)\hat{{\bm{t}}}^{(m)}t^(m). Std. MAE reflects the average error compared to the standard deviation of each target. Since this error is dominated by a few difficult targets (e.g. ϵHOMO\epsilon_{\text{HOMO}}ϵHOMO​) we also report logMAE, which reflects every relative improvement equally but is sensitive to outliers, such as SchNet’s result on <R2>\left<R^{2}\right>⟨R2⟩.

其中目标索引 mmm,目标数 M=12M=12M=12,数据集大小 NNN,真实值 t^(m)\hat{{\bm{t}}}^{(m)}t^(m),模型 fθ(m)f_{\theta}^{(m)}fθ(m)​,输入 Xi{\bm{X}}_{i}Xi​ 与 zi{\bm{z}}_{i}zi​,以及 t^(m)\hat{{\bm{t}}}^{(m)}t^(m) 的标准差 σm\sigma_{m}σm​。Std. MAE 反映相对各目标标准差的平均误差。由于该误差由少数困难目标主导(如 ϵHOMO\epsilon_{\text{HOMO}}ϵHOMO​),我们也报告 logMAE:它对每次相对改进同等反映,但对离群值敏感,例如 SchNet 在 <R2>\left<R^{2}\right>⟨R2⟩ 上的结果。

Appendix D DimeNet filters

附录 D DimeNet 滤波器

To illustrate the filters learned by DimeNet we separate the spatial dependency in the interaction function fintf_{\text{int}}fint​ via

为说明 DimeNet 学到的滤波器,我们把相互作用函数 fintf_{\text{int}}fint​ 中的空间依赖分离为

fint(m,dji,dkj,α(kj,ji))=∑n[σ(Wm+b)]nffilter1,n(dji)ffilter2,n(dkj,α(kj,ji)).(12)f_{\text{int}}({\bm{m}},d_{ji},d_{kj},\alpha_{(kj,ji)})=\sum_{n}\left[\sigma({\bm{W}}{\bm{m}}+{\bm{b}})\right]_{n}f_{\text{filter1},n}(d_{ji})f_{\text{filter2},n}(d_{kj},\alpha_{(kj,ji)}). \tag{12}fint​(m,dji​,dkj​,α(kj,ji)​)=n∑​[σ(Wm+b)]n​ffilter1,n​(dji​)ffilter2,n​(dkj​,α(kj,ji)​).(12)

The filters ffilter1,n:R+→Rf_{\text{filter1},n}:\mathbb{R}^{+}\rightarrow\mathbb{R}ffilter1,n​:R+→R and ffilter2,n:R+×[0,2π]→RFf_{\text{filter2},n}:\mathbb{R}^{+}\times[0,2\pi]\rightarrow\mathbb{R}^{F}ffilter2,n​:R+×[0,2π]→RF are given by

滤波器 ffilter1,n:R+→Rf_{\text{filter1},n}:\mathbb{R}^{+}\rightarrow\mathbb{R}ffilter1,n​:R+→R 与 ffilter2,n:R+×[0,2π]→RFf_{\text{filter2},n}:\mathbb{R}^{+}\times[0,2\pi]\rightarrow\mathbb{R}^{F}ffilter2,n​:R+×[0,2π]→RF 由下式给出

ffilter1,n(d)=(WRBFeRBF(d))n,ffilter2,n(d,α)=(WSBFaSBF(d,α))TWn,(13)\displaystyle f_{\text{filter1},n}(d)=({\bm{W}}_{\text{RBF}}{\bm{e}}_{\text{RBF}}(d))_{n}, \\ \displaystyle f_{\text{filter2},n}(d,\alpha)=({\bm{W}}_{\text{SBF}}{\bm{a}}_{\text{SBF}}(d,\alpha))^{T}{\bm{\mathsfit{W}}}_{n}, \tag{13}ffilter1,n​(d)=(WRBF​eRBF​(d))n​,ffilter2,n​(d,α)=(WSBF​aSBF​(d,α))TWn​,(13)

where WRBF{\bm{W}}_{\text{RBF}}WRBF​, WSBF{\bm{W}}_{\text{SBF}}WSBF​, and W{\bm{\mathsfit{W}}}W are learned weight matrices/tensors, eRBF(d){\bm{e}}_{\text{RBF}}(d)eRBF​(d) is the radial basis representation, and aSBF(d,α){\bm{a}}_{\text{SBF}}(d,\alpha)aSBF​(d,α) is the 2D spherical Fourier-Bessel representation. Fig. 7 shows how the first 15 elements of ffilter2,n(d,α)f_{\text{filter2},n}(d,\alpha)ffilter2,n​(d,α) vary with ddd and α\alphaα when choosing the tensor slice n=1n=1n=1 (with α=0\alpha=0α=0 at the top of the figure).

其中 WRBF{\bm{W}}_{\text{RBF}}WRBF​、WSBF{\bm{W}}_{\text{SBF}}WSBF​ 与 W{\bm{\mathsfit{W}}}W 为学得的权重矩阵/张量,eRBF(d){\bm{e}}_{\text{RBF}}(d)eRBF​(d) 为径向基表示,aSBF(d,α){\bm{a}}_{\text{SBF}}(d,\alpha)aSBF​(d,α) 为二维球面傅里叶–贝塞尔表示。图 7 展示取张量切片 n=1n=1n=1 时,ffilter2,n(d,α)f_{\text{filter2},n}(d,\alpha)ffilter2,n​(d,α) 的前 15 个元素如何随 ddd 与 α\alphaα 变化(图顶部 α=0\alpha=0α=0)。

Appendix E Multi-target results

附录 E 多目标结果

Target Unit Multi-target Sep. output blocks Single-target
μ\muμ D\mathrm{D}D 0.07750.07750.0775 0.08150.08150.0815 0.02860.02860.0286
α\alphaα a\mathrm{a}a 0.06490.06490.0649 0.06160.06160.0616 0.04690.04690.0469
ϵHOMO\epsilon_{\text{HOMO}}ϵHOMO​ meV\mathrm{meV}meV 45.145.145.1 45.545.545.5 27.827.827.8
ϵLUMO\epsilon_{\text{LUMO}}ϵLUMO​ meV\mathrm{meV}meV 41.141.141.1 33.933.933.9 19.719.719.7
Δϵ\Delta\epsilonΔϵ meV\mathrm{meV}meV 59.259.259.2 63.663.663.6 34.834.834.8
<R2>\left<R^{2}\right>⟨R2⟩ a\mathrm{a}a 0.3450.3450.345 0.3480.3480.348 0.3310.3310.331
ZPVE meV\mathrm{meV}meV 2.872.872.87 1.441.441.44 1.291.291.29
U0U_{0}U0​ meV\mathrm{meV}meV 12.912.912.9 10.610.610.6 8.028.028.02
UUU meV\mathrm{meV}meV 13.013.013.0 10.510.510.5 7.897.897.89
HHH meV\mathrm{meV}meV 13.013.013.0 10.410.410.4 8.118.118.11
GGG meV\mathrm{meV}meV 13.813.813.8 10.810.810.8 8.988.988.98
cvc_{\text{v}}cv​ calmol K\frac{\mathrm{cal}}{\mathrm{mol}\text{\,}\mathrm{K}}molKcal​ 0.03090.03090.0309 0.02830.02830.0283 0.02490.02490.0249
std. MAE %\mathrm{\%}% 1.921.921.92 1.901.901.90 1.051.051.05
logMAE - −5.07-5.07−5.07 −5.21-5.21−5.21 −5.57-5.57−5.57

Table 2: MAE on QM9 with multi-target learning. Single-target learning significantly improves performance on all targets. Using a separate output block per target slightly reduces this difference with little impact on training time.

Target Unit Multi-target Sep. output blocks Single-target
μ\muμ D\mathrm{D}D 0.07750.07750.0775 0.08150.08150.0815 0.02860.02860.0286
α\alphaα a\mathrm{a}a 0.06490.06490.0649 0.06160.06160.0616 0.04690.04690.0469
ϵHOMO\epsilon_{\text{HOMO}}ϵHOMO​ meV\mathrm{meV}meV 45.145.145.1 45.545.545.5 27.827.827.8
ϵLUMO\epsilon_{\text{LUMO}}ϵLUMO​ meV\mathrm{meV}meV 41.141.141.1 33.933.933.9 19.719.719.7
Δϵ\Delta\epsilonΔϵ meV\mathrm{meV}meV 59.259.259.2 63.663.663.6 34.834.834.8
<R2>\left<R^{2}\right>⟨R2⟩ a\mathrm{a}a 0.3450.3450.345 0.3480.3480.348 0.3310.3310.331
ZPVE meV\mathrm{meV}meV 2.872.872.87 1.441.441.44 1.291.291.29
U0U_{0}U0​ meV\mathrm{meV}meV 12.912.912.9 10.610.610.6 8.028.028.02
UUU meV\mathrm{meV}meV 13.013.013.0 10.510.510.5 7.897.897.89
HHH meV\mathrm{meV}meV 13.013.013.0 10.410.410.4 8.118.118.11
GGG meV\mathrm{meV}meV 13.813.813.8 10.810.810.8 8.988.988.98
cvc_{\text{v}}cv​ calmol K\frac{\mathrm{cal}}{\mathrm{mol}\text{\,}\mathrm{K}}molKcal​ 0.03090.03090.0309 0.02830.02830.0283 0.02490.02490.0249
std. MAE %\mathrm{\%}% 1.921.921.92 1.901.901.90 1.051.051.05
logMAE - −5.07-5.07−5.07 −5.21-5.21−5.21 −5.57-5.57−5.57

表 2:多目标学习下 QM9 上的 MAE。单目标学习在全部目标上显著提升表现。每目标使用单独输出块略微缩小该差距,对训练时间影响很小。