GraphNVP: An Invertible Flow Model for Generating Molecular Graphs

GraphNVP: An Invertible Flow Model for Generating Molecular Graphs

Kaushalya Madhawa, TTIC

Katushiko Ishiguro & Kosuke Nakago & Motoki Abe, Preferred Network, Inc

Introduction

GraphNVP分为两个步骤:

  1. 首先生成graph structure
  2. 然后根据graph structure来分配node attributes

GraphNVP会包含两种representation:

  1. adjacency tensor
  2. node label assignment

flow-based模型的一个优点就在于它是表示了精确的likelihood maximization,而不是VAE或者GAN用一些近似。我们这里介绍了两种reversible flow的类型对应于前面提到的两种latent representation。

normalizing flow最早是在 A family of non-parametric density estimation algorithms, 和 Density estimation by dual ascent of the log-likelihood 引入的。

然后Variational Inference with Normalizing FlowsNICE: NON-LINEAR INDEPENDENT COMPONENTS ESTIMATION 使用deep neural networks 定义了tractable invertible flows,尤其是后者介绍了reversible transformation,这个transformation中的log-determinant计算是可以tractable,而这个transformation就叫做coupling layers。coupling layers是flow-based generation model的基础。

GraphNVP: Flow-based graph generation model

Formulation

目标是学习一个invertible model $$f\theta, z = f\theta(G)$$。

Graph Representation

图的feature matrix和adjacency matrix都是离散的,而在离散的数据上使用continuous density model会带来degenerate probability distribution问题。因此我们采用的方法是将离散的数据给连续化,这一步骤叫做dequantization。简单的做法是加上uniform noise。

注意原始图的数据可以用一个floor函数得到。

Coupling layers

根据RealNVP,考虑两种类型的reversible affine coupling layers;adjacency coupling layers和node feature coupling layers。

我们用 $$z_X[l, :], z_X[l^{-}, :]$$ 分别表示 matrix 只包含第 $$l$$ 和只不包含 $$l$$ 的masked matrix。第 $$l$$ 个node feature coupling layer只更新feature matrix的第 $$l$$ 行,而保持其余行/node特征不变。即为:

$$ z_X^{(l)}[l,:] \leftarrow z_X^{(l-1)}[l, :] \odot \exp \big( s(z_X^{(l-1)}[l^{-}, :], A) \big) + t(z_X^{(l-1)}[l^{-}, :], A)\ z_X^{(l)}[l^{-}, :] \leftarrow z_X^{(l-1)}[l^{-}, :]

$$

这里的 $$s,t$$ 就是saling和transformation函数,我们用的是Relational GCN的变形。

对于adjacency layer,也是类似的想法。

$$ z_A^{(l)}[l,:,:] \leftarrow z_A^{(l-1)}[l,:,:] \odot \exp \big( s(z_A^{(l-1)}[l^{-},:,:]) \big) + t(z_A^{(l-1)}[l^{-},:,:])\ z_A^{(l)}[l^{-},:,:] \leftarrow z_A^{(l-1)}[l^{-},:,:]

$$

这里$$s,t$$ 用的是multi-layer perceptron (MLP)。

Masking Patterns and Permutation over Nodes

因为上述的coupling layer其实对于node并不是permutation invariant (也就是对于顺序是敏感的)。我们认为这个permutation dependency是当前work的一个限制,将来会继续解决这个问题。

Two-step Molecular Graph Generation

本文是假设adjacency matrix并不依赖于node feature matrix,但后者要依赖前者(也可以通过上述公式看出)。因此,这篇论文就先生成graph structure,然后再生成node attribute matrix。

  1. 从prior $$p_z$$ 中得到一个随机样本,$$z = concat(z_A, z_X)$$,然后分割成$$z_A, z_X$$。下面我们用一系列的操作来 反转/invert adjacency coupling layers。最后能得到一个probabilistic adjacency tensor $$\tilde A'$$,再根据这个构造出adjacency matrix $$A'$$。
  2. 从$$z_X$$和第一步生成的adjacency matrix $$A'$$ 来生成node feature matrix。生成过程还是inverted node feature coupling layers。

Appendix

In submission

知乎中提到的一句话:

需要说明的是,所有自回归流的模型都是建立在这样的一条理论基础上的:三角矩阵的行列式是其对角元素的乘积。

文章的想法很有意思,但是在训练的过程中,不应该是随机的prior。$$z_A, z_X$$两者相互之间应该是有某种regularization关系/相互联系。

results matching ""

    No results matching ""