异构神经网络(3)MAGNN: Metapath Aggregated Graph Neural Network for Heterogeneous Graph Embedding

MAGNN: Metapath Aggregated Graph Neural Network for Heterogeneous Graph Embedding这篇文章发表于WWW 2020。

Motivation

现在GNN(图神经网络)体系中先进的方法都假设输入是同构图,无法用于异构图的嵌入表示。现存的异构图嵌入方法都是基于meta-path的概念(具体概念可以参考前两篇异构神经网络论文),但这些方法都存在至少以下的一个问题:

  • 模型没有利用节点的内容信息特征,所以往往对于节点信息丰富的异构图,表现的不是很好;
  • 模型舍弃了meta-path的所有中间节点,而只考虑两个端节点,这样会造成信息丢失(比如这篇);
  • 模型依赖于一个单独的meta-path来编码异构图,需要一个手动的选择meta-path的过程,这样就损失了其他meta-path的信息,导致了不太好的效果。

Contribution

  • 使用了node content transformation,映射异构节点的属性到同一个潜在向量空间;
  • 对每个meta-paht使用intra-metra aggregation(with attention mechanism),同时聚合了邻居节点(meta-path的另一端节点)和在邻居节点之间的内容信息(meta-path上的中间节点);
  • 使用inter-meta aggregation(with attention mechanism),聚合多个meta-path的潜在嵌入向量,得到最终的节点embeddings。

Preliminary

  • 异构图: G = ( V , E ) \mathcal{G}=(V,\mathcal{E}) G=(V,E) A A A表示节点类型集合, R R R表示边类型集合。
  • meta-path: A 1 → R 1 A 2 → R 2 … → R l A ( l + 1 ) A_1 \stackrel{R_1}{\rightarrow}A_2 \stackrel{R_2}{\rightarrow}\ldots\stackrel{R_{l}}{\rightarrow}A_{(l+1)} A1R1A2R2RlA(l+1)
    表示节点类别 A 1 A l + 1 A_1 A_{l+1} A1Al+1之间的一种组合关系: R = R 1 ∘ R 2 ∘ … ∘ R l R=R_1\circ R_2 \circ \ldots\circ R_l R=R1R2Rl,比如两个电影之间的关系,MAM,表示movie-actor-movie,两个电影都有同一个演员;MDM,表示movie-director-movie,两个电影是同一个导演。
  • meta-path instance:对于meta-path P P P,其instance p p p表示遵循 P P P模式定义的节点序列;
  • meta-path neighbor: N v P N_v^P NvP表示节点 v v v经过 P P P的meta-instance 与节点 v v v相连的节点;
  • metapath-based graph: G P \mathcal{G}^P GP表示所有基于meta-path P P P的节点对构成的图,如果P是对称的,那么 G P \mathcal{G}^P GP是同构图;
  • heterogeneous graph embedding:对于异构图 G = ( V , E ) \mathcal{G}=(V,\mathcal{E}) G=(V,E),节点特征为 X A i ∈ R ∣ V A i ∣ × d A i X_{A_i}∈R^{|V_{A_i}|×d_{A_i}} XAiRVAi×dAi A i A_i Ai表示节点类别,异构图嵌入的任务是对于所有节点 v v v学习 h v ∈ R d h_v∈R^d hvRd,且这个嵌入能捕捉到图 G \mathcal{G} G丰富的结构和语义信息。

Model

Node Content Transformation

这一步是为了便于后续的聚合操作,对于不同的节点特征,学习对应的映射向量,将不同类别的节点特征向量映射到同一个特征空间中。

不同类别的节点有着不同维度的特征向量,即使这些特征向量在相同的维度,但也许是不同的特征空间。所以首先需要映射不同类别的节点特征到相同的潜在空间中。
对于节点 v ∈ V A v∈V_A vVA,也就是类别为 A A A的节点,其映射为:
h v ′ = W A ⋅ x v A (1) h_v'=W_A·x_v^A\tag{1} hv=WAxvA(1) x v A x_v^A xvA表示节点 v v v的原始特征向量, h v ′ h_v' hv表示映射后的潜在特征向量。

Intra-metapth Aggregation

这一步是为了学习与 v v v相连的同一个metapath的信息,包括the meta-path based neighbors和the context between。首先是编码metapath instances。
编码的做法是下式,具体设计在后续会介绍:
h P ( v , u ) = f θ ( P ( v , u ) ) = f θ ( h v ′ , h u ′ , { h t ′ , ∀ t ∈ { m P ( v , u ) } } ) (2) h_{P(v,u)}=f_\theta(P(v,u))=f_\theta(h_v',h_u',\{h_t',\forall t∈\{m^{P(v,u)}\}\})\tag{2} hP(v,u)=fθ(P(v,u))=fθ(hv,hu,{ht,t{mP(v,u)}})(2)
在得到基于 P P P的编码后,需要聚合所有与目标节点 v v v相关的metapath instances P P P的编码,具体的做法是针对每个metapath P P P,学习归一化的权重 α v u P \alpha^P_{vu} αvuP
e v u P =  LeakyReLU  ( a P T ⋅ [ h v ′ ∥ h P ( v , u ) ] ) α v u P = exp ⁡ ( e v u P ) ∑ s ∈ N v P exp ⁡ ( e v s P ) h v P = σ ( ∑ u ∈ N v P α v u P ⋅ h P ( v , u ) ) (3) \begin{aligned} e_{v u}^{P} &=\text { LeakyReLU }\left(\mathrm{a}_{P}^{T} \cdot\left[\mathbf{h}_{v}^{\prime} \| \mathbf{h}_{P(v, u)}\right]\right)\\ \alpha_{v u}^{P} &=\frac{\exp \left(e_{v u}^{P}\right)}{\sum_{s \in \mathcal{N}_{v}^{P}} \exp \left(e_{v s}^{P}\right)} \\ \mathbf{h}_{v}^{P} &=\sigma\left(\sum_{u \in \mathcal{N}_{v}^{P}} \alpha_{v u}^{P} \cdot \mathbf{h}_{P(v, u)}\right) \end{aligned}\tag{3} evuPαvuPhvP= LeakyReLU (aPT[hvhP(v,u)])=sNvPexp(evsP)exp(evuP)=σuNvPαvuPhP(v,u)(3)同样,作者也给出了multiple head attention的表示。
从而得到了节点 v v v对于metapath P P P的表示。

Inter-metapath Aggregation

这一步是为了学习聚合不同metapath的信息。
对于节点类别 A A A,metapaths集合 P A = { P 1 , P 2 , … , P M } P_A=\{P_1,P_2,\ldots,P_M\} PA={P1,P2,,PM},在上一步中分别学习到了其潜在的表示向量 { h v P 1 , h v P 2 , … , h v P M } \{h_v^{P_1},h_v^{P_2},\ldots,h_v^{P_M}\} {hvP1,hvP2,,hvPM}

  • 首先,平均所有节点 v ∈ V A v∈V_A vVA,关于特定的metapath P i P_i Pi潜在表示向量,得到 s P i s_{P_i} sPi s P i = 1 ∣ V A ∣ ∑ v ∈ V A tanh ⁡ ( M A ⋅ h v P i + b A ) \mathbf{s}_{P_{i}}=\frac{1}{\left|\mathcal{V}_{A}\right|} \sum_{v \in \mathcal{V}_{A}} \tanh \left(\mathbf{M}_{A} \cdot \mathbf{h}_{v}^{P_{i}}+\mathbf{b}_{A}\right) sPi=VA1vVAtanh(MAhvPi+bA)
    M A M_A MA b A b_A bA是可学习参数,用于嵌入表示的线性变换。
  • 然后使用注意力机制,来学习metapath P i P_i Pi对于类别 A A A的节点的重要性,用 β P i \beta_{P_i} βPi表示。 e P i = q A ⊤ ⋅ s P i β P i = exp ⁡ ( e P i ) ∑ P ∈ P A exp ⁡ ( e P ) h v P A = ∑ P ∈ P A β P ⋅ h v P \begin{array}{l} e_{P_{i}}=\mathrm{q}_{A}^{\top} \cdot \mathrm{s}_{P_{i}} \\ \beta_{P_{i}}=\frac{\exp \left(e_{P_{i}}\right)}{\sum_{P \in \mathcal{P}_{A}} \exp \left(e_{P}\right)} \\ \mathbf{h}_{v}^{\mathcal{P}_{A}}=\sum_{P \in \mathcal{P}_{A}} \beta_{P} \cdot \mathbf{h}_{v}^{P} \end{array} ePi=qAsPiβPi=PPAexp(eP)exp(ePi)hvPA=PPAβPhvP
    得到了聚合 P A P_A PA中所有metapath后的,节点 v v v的表示 h v P A h_v^{P_A} hvPA
  • 最终,再用一个线性变换和非线性变换来映射到最终的输出维度: h v = σ ( W o ⋅ h v P A ) \mathbf{h}_{v}=\sigma\left(\mathbf{W}_{o} \cdot \mathbf{h}_{v}^{\mathcal{P}_{A}}\right) hv=σ(WohvPA)

Metapath Instance Encoders

介绍了平均、线性以及relational rotation encoder,用于聚集metapath instance中端节点和中间节点的信息。
前面两种方法认为metapath instance是一个集合,而忽略了其中的序列结构。最后一种则考虑了instance内部的序列关系: o 0 = h t 0 ′ = h u ′ o i = h t i ′ + o i − 1 ⊙ r i h P ( v , u ) = o n n + 1 \begin{array}{l} o_{0}=h_{t_{0}}^{\prime}=h_{u}^{\prime} \\ o_{i}=h_{t_{i}}^{\prime}+o_{i-1} \odot \mathbf{r}_{i} \\ h_{P(v, u)}=\frac{o_{n}}{n+1} \end{array} o0=ht0=huoi=hti+oi1rihP(v,u)=n+1on

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Semi-supervised classification with graph convolutional networks (GCNs) is a method for predicting labels for nodes in a graph. GCNs are a type of neural network that operates on graph-structured data, where each node in the graph represents an entity (such as a person, a product, or a webpage) and edges represent relationships between entities. The semi-supervised classification problem arises when we have a graph where only a small subset of nodes have labels, and we want to predict the labels of the remaining nodes. GCNs can be used to solve this problem by learning to propagate information through the graph, using the labeled nodes as anchors. The key idea behind GCNs is to use a graph convolution operation to aggregate information from a node's neighbors, and then use this aggregated information to update the node's representation. This operation is then repeated over multiple layers, allowing the network to capture increasingly complex relationships between nodes. To train a GCN for semi-supervised classification, we use a combination of labeled and unlabeled nodes as input, and optimize a loss function that encourages the network to correctly predict the labels of the labeled nodes while also encouraging the network to produce smooth predictions across the graph. Overall, semi-supervised classification with GCNs is a powerful and flexible method for predicting labels on graph-structured data, and has been successfully applied to a wide range of applications including social network analysis, drug discovery, and recommendation systems.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值