图上的迁移学习(二)
Domain Adaptive Classification on Heterogeneous Information Networks ——MuSDAC 笔记
定义
异构网络(Heterogeneous Information Network, HIN):
G
=
(
V
,
ε
)
\mathcal{G}=(\mathcal{V}, \varepsilon)
G=(V,ε)
其中
v
=
∪
i
=
1
n
V
i
\mathcal{v}=\cup_{i=1}^{n} \mathcal{V_i}
v=∪i=1nVi,有 n 个类型的点。
ε
=
∪
i
=
1
m
ε
i
\varepsilon=\cup_{i=1}^{m} \varepsilon_i
ε=∪i=1mεi,有 m 个类型的边。
在网络中一个元路径(meta-path)
Φ
i
\Phi_i
Φi 是以下格式的一条路:
V
i
1
→
ε
i
1
V
i
2
→
ε
i
2
⋯
→
ε
i
l
V
i
(
l
+
1
)
\mathcal{V}_{i_1} \xrightarrow{\varepsilon_{i_1}} \mathcal{V}_{i_2} \xrightarrow{\varepsilon_{i_2}} \dots \xrightarrow{\varepsilon_{i_l}} \mathcal{V}_{i_{(l+1)}}
Vi1εi1Vi2εi2⋯εilVi(l+1)
定义了两个点
V
i
1
\mathcal{V}_{i_1}
Vi1 和
V
i
(
l
+
1
)
\mathcal{V}_{i_{(l+1)}}
Vi(l+1) 之间的组合关系。
multi-channel Network:
给定
V
i
1
\mathcal{V}_{i_1}
Vi1 为未决策分类的节点,通过 meta-path set
Φ
=
{
Φ
1
,
…
,
Φ
N
}
\Phi= \{ \Phi_1,\dots,\Phi_N \}
Φ={Φ1,…,ΦN} 将 HIN 分解为multi-channel network。其中每个 channel 都是包含节点
V
i
1
\mathcal{V}_{i_1}
Vi1 与某一特定类型的元路径相连的同质网络。最终的网络被定义为
G
=
{
(
V
l
,
A
l
)
∣
l
=
1
,
…
,
N
}
G=\{ (\mathcal{V}_l, A_l) \vert l=1,\dots, N \}
G={(Vl,Al)∣l=1,…,N}
其中
A
l
A_l
Al 为元路径邻接矩阵,表示
V
l
\mathcal{V}_l
Vl 中连接
V
1
\mathcal{V_1}
V1每个节点对的元路径数。
MuSDAC 基本思想
解决的问题: 异构网络上的 Domain Adaptation(DA) 问题:
给定两个 HINs,
(
G
S
,
X
S
)
(\mathcal{G_S}, \mathcal{X_S})
(GS,XS) 和
(
G
T
,
X
T
)
(\mathcal{G_T}, \mathcal{X_T})
(GT,XT), 其中
X
\mathcal{X}
X 代表
V
1
\mathcal{V_1}
V1节点的feature matrix,
G
S
\mathcal{G_S}
GS 和
G
T
\mathcal{G_T}
GT 分享相同的 node 和 edge 特征。在 HINs上的可转移分类目标是使用两个网络上的结构信息和
V
S
,
1
\mathcal{V_{S,1}}
VS,1 的 label 来预测
V
T
,
1
\mathcal{V_{T,1}}
VT,1 上的 label。
异构网络(HIN)上的 domain adaptation 面临的挑战:
- HIN 包括多种语义,需要做域对齐。如果在一个 embedding space 并行它们是非常难的。
- 需要在领域相似性和可区分性之间进行平衡。因为领域不变的特征是同构的,并且对于对于分类来说是无信息的。另一方面,指示分类的特征通常是领域变化的。
解决的方法: 提出 Multi-space Domain Adaptive Classification(MuSDAC) 来解决 HINs 上的 DA 问题 :
- 使用 multi-channel shared weight GCNs,将 HIN 的 node 投影到 multi-space 中,并且进行了两两对齐。使得每个空间的多层语义被单独保存。
- 提出一个两层选择策略,有效地聚集嵌入空间,以确保领域的相似性和可区分性。
第一层使用 heuristic combination sampling algorithm,有效地选择具有可区分性的通道组合。减轻了空间组合搜索的需要。
第二层使用 moving averaged weighted voting scheme,对第一层被选择的通道进行加权融合,以最小化 transfer 和 classification loss。
MuSDAC 算法框架
论文中MuSDAC的框架如下
-
Multi-channel shared Weight GCN. 使用 meta-space set Φ \Phi Φ,将 G S \mathcal{G_S} GS , G T \mathcal{G_T} GT 分解为多通道网络,并且将它们丢入到 N 个独立的 GCN 中,产生 original channel。最终得到 original channel embedding sets C = { C l ∣ l = 1 , … , N } C=\{ C_l \vert l=1,\dots, N \} C={Cl∣l=1,…,N}:
C l = A ^ l σ ( A ^ l X W l ( 0 ) ) W l ( 1 ) C_l= \hat{A}_l \sigma(\hat{A}_l \mathcal{X} W_l^{(0)} ) W_l^{(1)} Cl=A^lσ(A^lXWl(0))Wl(1)
其中 A ^ = D ~ − 1 2 A ~ D ~ − 1 2 \hat{A}=\tilde{D}^{-\frac{1}{2}} \tilde{A} \tilde{D}^{-\frac{1}{2}} A^=D~−21A~D~−21。在 channel l l l 中,使用 shared parameter set { W l 0 , W l ( 1 ) } \{ W_{l}^{0}, W_{l}^{(1)}\} {Wl0,Wl(1)}。 -
Multi-space Alignment.
-
使用 heuristic combination sampling algorithm (Algorithm 1) 生成特征可分辨的组合下标 Z = { Z j ∣ j = 1 , … , M } , Z j ∈ { 1 , … , N } , M = O ( N ) Z=\{ Z_j \vert j=1,\dots, M \}, Z_j \in \{1,\dots,N\}, M=O(N) Z={Zj∣j=1,…,M},Zj∈{1,…,N},M=O(N)。
-
根据下标挑选出组合特征 C Z = { C l ∣ l ∈ Z } C_Z=\{ C_l \vert l \in Z \} CZ={Cl∣l∈Z}。
-
通过一维卷积组合 C Z C_Z CZ 得到 aggregated channel embedding set M = { M Z j ∣ j = 1 , … , M } \mathcal{M}=\{ \mathcal{M_{Z_j} }\vert j=1,\dots, M \} M={MZj∣j=1,…,M},其中 M Z j \mathcal{M_{Z_j} } MZj 为单个 embedding matrix
-
在第 j j j 个 aggregated channel Z j Z_j Zj 中,使用 M Z j , S M_{Z_j,S} MZj,S, M Z j , T M_{Z_j,T} MZj,T 代表 source 和 target instance 的嵌入,用于预测分类器:
y ^ j = s o f t m a x ( M Z j , W j C ) \hat{y}_j=softmax(M_{Z_j}, W_j^C) y^j=softmax(MZj,WjC)
其中 W j C W_{j}^{C} WjC 为第 j j j 个 channel 的分类器参数。 -
最终的预测是所有分类器输出的 weighted voting。
y ^ = ∑ j θ j y j \hat{y}=\sum_{j} \theta_{j} y_j y^=j∑θjyj
- overall loss function.
根据 DAC 理论,通过减小在 M Z j , S \mathcal{M_{Z_j,S}} MZj,S 上的分类误差 & M Z j , S \mathcal{M_{Z_j, S}} MZj,S, M Z j , T \mathcal{M_{Z_j, T}} MZj,T 之间的距离, 可以减少在第 j j j 个通道上 target label 的预测误差。因此第 j j j 个通道 Z j Z_j Zj 的 loss function L Z j , D = C E ( y ^ j , S , y S ) L_{Z_j, D}= CE( \hat{y}_{j,S} , y_S) LZj,D=CE(y^j,S,yS)
L Z j , T = M M D ( M Z j , S , M Z j , T ) L_{Z_j, T}= MMD(M_{Z_j, S}, M_{Z_j, T}) LZj,T=MMD(MZj,S,MZj,T)
L Z j = L Z j , D + γ L Z j , T L_{Z_j}= L_{Z_j, D} + \gamma L_{Z_j, T} LZj=LZj,D+γLZj,T
Over all loss 是从 aggregated channel 的 DAC loss 的加权和
L = ∑ j θ j L Z j L=\sum_{j} \theta_j L_{Z_j} L=j∑θjLZj
模型细节
- 组合下标的选择—— 使用 heuristic combination sampling algorithm。
第一次迭代,在两个通道组成的组合中选择 N − w N-w N−w 个 Loss 最小的组合通道作为下次迭代的基础。
第二次迭代,在三个通道组合的组合中选择 N − w N-w N−w 个 Loss 最小的组合通道作为下次迭代的基础。 为了减小搜索规模,所有被选择的三个通道需要包含第一步选择的两个通道。
⋯ \cdots ⋯
-
θ
\theta
θ 的选择:Moving averaged Strategy
(1) 通过 loss value 计算 θ ~ \tilde{\theta} θ~
β j = − η L Z j \beta_j=- \eta L_{Z_j} βj=−ηLZj
θ j ~ = e x p β j ∑ i e x p β i \tilde{\theta_j} = \frac{exp \beta_j}{\sum_{i} exp \beta_{i} } θj~=∑iexpβiexpβj
(2) 更新 θ \theta θ
θ = α θ + ( 1 − α ) θ ~ , 0 < α < 1 \theta = \alpha \theta + (1-\alpha) \tilde{\theta} , 0< \alpha <1 θ=αθ+(1−α)θ~,0<α<1
初始的 θ j = 1 / M \theta_j=1/M θj=1/M 。
Network Together: Node Classification via Cross-Network Deep Network Embedding——CDNE算法笔记
CDNE 基本思想
- 使用网络结构来捕捉节点间的临近度——将强连接的节点映射为更相似的 latent vector representation。使用 SAE_s 和 SAE_s 来重构 source network 和 target network 的网络结构临近度矩阵。
- 使用 node attributes 和 labels 来捕捉不同网络中节点的临近度——将相同 label 的 node 有对齐的 latent vector representation.
其中 SAE_s 是在 source network 上被训练,将相同类的节点映射到更加接近的位置,以便于后续的标签分类任务。
当 SAE_s 收敛或者迭代达到最大值,SAE_s 被固定。然后被 SAE_s 学到的 source network 中的 latent representation 作为训练 SAE_t 的部分输入。SAE_t 的目标就是学习网络不变的节点表达,使得 source network 相同 label 的节点有相同的 latent represnetation。
最后,通过 CDNE 学习 label-discriminative and network-invariant 节点表达。
符号说明
G
s
=
(
V
s
,
E
s
,
Y
s
)
\mathcal{G^{s}}=(V^s,E^s,Y^s)
Gs=(Vs,Es,Ys) 为 fully labeled source network,
V
s
V^s
Vs 为 a set of all labeled nodes,
E
s
E^s
Es 为 a set of edges,
Y
s
∈
R
n
s
×
C
Y^s \in R^{n^s \times C}
Ys∈Rns×C,
Y
i
c
s
=
1
Y^s_{ic}=1
Yics=1 说明 node
v
i
s
v_i^s
vis 与 label c 有关,
Y
i
c
s
=
0
Y^s_{ic}=0
Yics=0 说明 node
v
i
s
v_i^s
vis 与 label c 无关,一个点可以有多个 label。
G
t
=
(
V
t
,
E
t
,
Y
t
)
\mathcal{G^{t}}=(V^t,E^t,Y^t)
Gt=(Vt,Et,Yt) 为 insufficiently labeled target network,
V
t
=
{
V
L
t
,
V
U
t
}
V^t=\{ V_{L}^{t}, V_{U}^{t} \}
Vt={VLt,VUt},
V
L
t
V_{L}^{t}
VLt 为由 labeled node 组成的小的集合,
V
U
t
V_{U}^{t}
VUt 为由 unlabeled node 组成的大的集合,
CDNE 算法框架
-
在 Source network 中的 SAE_s。
Preserving Source-Network Structural Proximities .
给定 source network 的 PPMI 矩阵 X s ∈ R n s × n s X^s \in R^{n^s \times n^s} Xs∈Rns×ns【根据网络的拓扑结构建立起的矩阵,详见 B 部分】作为输入,一个L层的 SAE_s 如下:
H s ( l ) = f ( H s ( l − 1 ) ( W 1 s ( l ) ) T + B 1 s ( l ) ) , l = 1 , … , L H^{s(l)} =f (H^{s(l-1)}(W_1^{s(l)}) ^{T} +B_1^{s(l)} ), l=1,\dots, L Hs(l)=f(Hs(l−1)(W1s(l))T+B1s(l)),l=1,…,L
H ^ s ( l − 1 ) = f ( H ^ s ( l ) ( W 2 s ( l ) ) T + B 2 s ( l ) ) , l = 1 , … , L \hat{H}^{s(l-1)} =f (\hat{H}^{s(l)}(W_2^{s(l)}) ^{T} +B_2^{s(l)} ), l=1,\dots, L H^s(l−1)=f(H^s(l)(W2s(l))T+B2s(l)),l=1,…,L
分别代表 SAE_s 的编码和解码的过程。 H s ( 0 ) = X s H^{s(0)}=X^s Hs(0)=Xs, H s ( l ) ∈ R n s × d ( l ) H^{s(l)} \in R^{n^s \times d(l)} Hs(l)∈Rns×d(l) 代表学到的第 l l l 层 matrix representation, H i s ( l ) ∈ R 1 × d ( l ) H^{s(l)}_i\in R^{1\times d(l)} His(l)∈R1×d(l) 为 H s ( l ) H^{s(l)} Hs(l) 的第 i i i 行,代表 v i s v_i^s vis 的节点表达。本文中选取激活函数为 sigmoid activation f ( x ) = 1 / ( 1 + e − x ) f(x)=1/(1+e^{-x}) f(x)=1/(1+e−x)。
为了解决网络稀疏的问题,在重建误差中引入 penalty matrix P s ( l ) P^{s(l)} Ps(l),
R s ( l ) = 1 2 n s ∥ P s ( l ) ⊙ ( H ^ s ( l − 1 ) − H s ( l − 1 ) ) ∥ F 2 \mathcal{R^{s(l)}}=\frac{1}{2n^s} \Vert P^{s(l)} \odot ( \hat{H}^{s(l-1)} - H^{s(l-1)} ) \Vert_F^2 Rs(l)=2ns1∥Ps(l)⊙(H^s(l−1)−Hs(l−1))∥F2
where if H i j s ( l − 1 ) > 0 H_{ij}^{s(l-1)}>0 Hijs(l−1)>0, P i j s ( l ) = β > 1 P_{ij}^{s(l)}=\beta >1 Pijs(l)=β>1;if H i j s ( l − 1 ) = 0 H_{ij}^{s(l-1)}=0 Hijs(l−1)=0, P i j s ( l ) = 1 P_{ij}^{s(l)}=1 Pijs(l)=1。
加入 pairwise constraint 使得强连接的节点有更加相似的 latent node vector representation.
C s ( l ) = 1 2 n s ∑ i = 1 n s ∑ j = 1 n s X i j s ∥ H i s ( l ) − H j s ( l ) ∥ 2 . C^{s(l)}=\frac{1}{2n^s} \sum_{i=1}^{n^s} \sum_{j=1}^{n^s} X_{ij}^{s} \Vert H_{i}^{s(l)}- H_{j}^{s(l)} \Vert ^2. Cs(l)=2ns1i=1∑nsj=1∑nsXijs∥His(l)−Hjs(l)∥2.
Label-Discriminative Representation.
定义矩阵 O s ∈ R n s × n s O^{s} \in R^{n^s \times n^s} Os∈Rns×ns 代表两个节点是否有相同的 label。 O i j s = − 1 O_{ij}^{s}=-1 Oijs=−1,如果 v i s v_i^{s} vis 和 v j s v_{j}^{s} vjs 没有共同的 label。 O i j s ≥ 1 O_{ij}^{s} \geq 1 Oijs≥1 代表 v i s v_i^s vis 和 v j s v_j^s vjs 具有共同的 label 的数量。label 可辨别的 pairwise constraint —— 有共同 label 的节点有相似的 vector representation:
L s ( l ) = 1 2 n s ∑ i = 1 n s ∑ j = 1 n s O i j s ∥ H i s ( l ) − H j s ( l ) ∥ 2 。 L^{s(l)}=\frac{1}{2n^s} \sum_{i=1}^{n^s} \sum_{j=1}^{n^s} O_{ij}^{s} \Vert H_{i}^{s(l)}- H_{j}^{s(l)} \Vert ^2。 Ls(l)=2ns1i=1∑nsj=1∑nsOijs∥His(l)−Hjs(l)∥2。
L 2 L_2 L2-norm regularization 防止过拟合
Ω s ( l ) = ( ∥ W 1 s ( l ) ∥ F + ∥ W 2 s ( l ) ∥ F ) / 2. \Omega ^{s(l)}=(\Vert W_1^{s(l)} \Vert_F+\Vert W_2^{s(l)} \Vert_F)/2. Ωs(l)=(∥W1s(l)∥F+∥W2s(l)∥F)/2.
Overall loss function
J s ( l ) = R s ( l ) + α C s ( l ) + φ s ( l ) L s ( l ) + λ s ( l ) Ω s ( l ) J^{s(l)}=\mathcal{R^{s(l)}} + \alpha C^{s(l)} + \varphi^{s(l)} L^{s(l)} +\lambda^{s(l)} \Omega^{s(l)} Js(l)=Rs(l)+αCs(l)+φs(l)Ls(l)+λs(l)Ωs(l) -
在 target network 中的 SAE_t。
Preserving Target-Network Structural Proximities.
与 SAE_s 相同,以 PPMI 矩阵为输入构建 编码-解码器,得到每层的 matrix representation。构建了类似的重建误差和 pairwise constraint 使得强连接的节点有更加相似的 latent node vector。
Network-Invariant representations.
在 domain adaptation 中, MMD 是广泛被采用的,无参数的,度量两个 domain 中分布距离的而方法。
首先定义 source network 和 target network 间 empirical marginal MMD:
M M t ( l ) = 1 2 ∥ 1 n s 1 s H s ( l ) − 1 n t 1 t H t ( l ) ∥ 2 \mathcal{M}_{M}^{t(l)} =\frac{1}{2} \Vert \frac{1}{n^s} 1^s H^{s(l)} - \frac{1}{n^t} 1^t H^{t(l)} \Vert^2 MMt(l)=21∥ns11sHs(l)−nt11tHt(l)∥2
其中 1 s ∈ R 1 × n s 1^s \in R^{1 \times n^s} 1s∈R1×ns, 1 t ∈ R 1 × n t 1^t \in R^{1 \times n^t} 1t∈R1×nt。通过最小化上式,从 target network 中学到的 node representation 的 marginal distribution 可以与 source network 的 marginal distribution 匹配。
然后,定义 source network 和 target network 间的 class-conditional MMD:
M c t ( l ) = ∑ c = 1 C 1 2 ∥ ∑ i = 1 n t Y ^ i c t H i t ( l ) ∑ i = 1 n t Y ^ i c t − ∑ j = 1 n s Y j c s H j s ( l ) ∑ j = 1 n s Y j c s ∥ 2 \mathcal{M_c^{t(l)}} = \sum_{c=1}^{C} \frac{1}{2} \Vert \frac{\sum_{i=1}^{n^t \hat{Y}_{ic}^{t} H_{i}^{t(l)} }}{\sum_{i=1}^{n^t} \hat{Y}_{ic}^{t} }- \frac{\sum_{j=1}^{n^s Y_{jc}^{s} H_{j}^{s(l)} }}{\sum_{j=1}^{n^s} Y_{jc}^{s} } \Vert^2 Mct(l)=c=1∑C21∥∑i=1ntY^ict∑i=1ntY^ictHit(l)−∑j=1nsYjcs∑j=1nsYjcsHjs(l)∥2
最小化上式,代表source network 和 target network 中,每一类的 latent representation 都很接近。
其中 Y ^ t \hat{Y}^{t} Y^t 代表 target network 的 predicted label matrix
Y ^ i c t = { Y i c t ∈ { 0 , 1 } v i t ∈ V L t p r e d i c t e d p r o b a b i l i t y o f v i t t o b e l a b e l e d w i t h c a t e g o r y c v i t ∈ V U T \hat{Y}_{ic}^{t}=\begin{cases} Y_{ic}^{t} \in \{0,1\} & v_i^t \in V_{L}^{t}\\ predicted\; probability\; of\; v_i^t \;to\; be\; labeled\; with\; category\; c & v_i^t \in V_{U}^{T}\end{cases} Y^ict={Yict∈{0,1}predictedprobabilityofvittobelabeledwithcategorycvit∈VLtvit∈VUT
同样,为了防止过拟合,构架 L 2 − n o r m r e g u l a r i z a i t o n L2-norm regularizaiton L2−normregularizaiton,SAE_t 的第 l l l 层 overall loss function 为:
J t ( l ) = R t ( l ) + α t ( l ) C t ( l ) + μ M M t ( l ) + γ t ( l ) M c t ( l ) + λ t ( l ) Ω t ( l ) J^{t(l)}=\mathcal{R^{t(l)}} + \alpha^{t(l)} C^{t(l)} + \mu \mathcal{M}_{M}^{t(l)} + \gamma^{t(l)} \mathcal{M_c^{t(l)}}+\lambda^{t(l)} \Omega^{t(l)} Jt(l)=Rt(l)+αt(l)Ct(l)+μMMt(l)+γt(l)Mct(l)+λt(l)Ωt(l) -
最终的优化算法
实验
Dataset 1. Blog1 和 Blog2 是从BlogCatalog data set [https://github.com/xhuang31/LANE] 中抽取的两个不相交的子网络。一个 node 代表一个 blogger,一条边代表两个 blogger 之间的 friendship。每个点的 attribute 为 blogger’s self-description 中抽取的 keywords 组成,每个点的 label 为 blogger’s interest group。
Dataset 2. Citationv1, DBLPv7, and ACMv9 是从ArnetMiner data set 中抽取的三个引文网络[https://www.aminer.cn/citation]。
从实验中可以看出,CDNE 方法比一般方法效果都好。并且对于噪声有更好的鲁棒性。
Adversarial Deep Network Embedding for Cross-network node classification——ACDNE算法笔记
基本思想
- 使用两个特征提取器,分别基于自己的 Attribute 和 neighbor’s attribute 来学习节点的表达。因此,attributed affinity 和 topological proximities 被保存。
- 使用一个节点分类器,使得节点表达可以用于后续辨别标签的任务中。
- 使用一个 adversarial domain adaptation technique,使得节点表达是网络不变的。
前人研究存在的问题 虽然 attributed network embedding algorithm 可以捕捉不同网络中节点间的 proximities,但是没有人考虑网络间的 domain discrepancy。
符号说明
算法框架
论文中算法框架如图所示
- deep network embedding
包含两个 feature extractors,1个 concatenation layer,1个pairwise constraint。
- FE1.
input: each node’s attribute
hidden layers: 有 l f l_f lf 个隐藏层
h f 1 k ( x i ) = R e L U ( h f 1 ( k − 1 ) ( x i ) W f 1 ( k ) + b f 1 k ) , 1 ≤ k ≤ l f h_{f_1}^{k} (x_i) = ReLU ( h_{f_1}^{(k-1)}(x_i) W_{f_1}^{(k)} +b_{f_1}^{k} ), 1\leq k \leq l_f hf1k(xi)=ReLU(hf1(k−1)(xi)Wf1(k)+bf1k),1≤k≤lf
其中 h f 1 ( 0 ) ( x i ) = x i ∈ R 1 × w h_{f_1}^{(0)} (x_i) =x_i \in R^{1 \times w} hf1(0)(xi)=xi∈R1×w,代表 v i v_i vi 的 attribute vector。
x i k x_{ik} xik 为 v i v_i vi 的第 k k k 个 attributed value。
h f 1 ( k ) ( x i ) ∈ R 1 × f ( k ) h_{f_1}^{(k)}(x_i) \in R^{1 \times f(k)} hf1(k)(xi)∈R1×f(k) 为 FE1 第 k 个隐藏层学到的 v i v_i vi 的节点表达。
W f 1 ( k ) W_{f_1}^{(k)} Wf1(k) 为 trainable weight, b f 1 ( k ) b_{f_1}^{(k)} bf1(k) 为 trainable bias parameters。
- FE2.
input: neighbors’ attribute
hidden layers: 有 l f l_f lf 个隐藏层
h f 2 k ( n i ) = R e L U ( h f 2 ( k − 1 ) ( n i ) W f 2 ( k ) + b f 2 k ) , 1 ≤ k ≤ l f h_{f_2}^{k} (n_i) = ReLU ( h_{f_2}^{(k-1)}(n_i) W_{f_2}^{(k)} +b_{f_2}^{k} ), 1\leq k \leq l_f hf2k(ni)=ReLU(hf2(k−1)(ni)Wf2(k)+bf2k),1≤k≤lf
其中 h f 2 ( 0 ) ( n i ) = n i ∈ R 1 × w h_{f_2}^{(0)} (n_i) =n_i \in R^{1 \times w} hf2(0)(ni)=ni∈R1×w,代表 v i v_i vi 的邻居特征向量。【aggregate the neighbor’s attribute】
n i , k = ∑ j = 1 , j ≠ i n a i j ∑ g = 1 , g ≠ i n a i g x j l n_{i,k}= \sum_{j=1,j\neq i}^{n} \frac{a_{ij}}{\sum_{g=1, g\neq i}^{n} a_{ig}} x_{jl} ni,k=j=1,j=i∑n∑g=1,g=inaigaijxjl
其中 a i j a_{ij} aij 代表 v i v_i vi 和 v j v_j vj 间的拓扑距离,使用PPMI metric 度量 k steps 内节点的 topological proximity。 a i j a_{ij} aij 越大,说明 v i v_i vi 和 v j v_j vj 越接近; a i j = 0 a_{ij}=0 aij=0,说明 v i v_i vi 不是 v j v_j vj k step 内的邻居。
- Concatenation layer.
e i = R e L U ( [ h f 1 l f ( x i ) , h f 2 l f ( n i ) ] W c + b c ) e_i=ReLU([h_{f_1}^{l_f}(x_i), h_{f_2}^{l_f}(n_i)] W_c + b_c) ei=ReLU([hf1lf(xi),hf2lf(ni)]Wc+bc)
e i ∈ R 1 × d e_i \in R^{1 \times d} ei∈R1×d 为被 ACDNE 最终学到的 node representation。 - Pairwise constraint.
L p = 1 n s ∑ v i , v j ∈ V s a i j ∥ e i − e j ∥ 2 + 1 n t ∑ v i , v j ∈ V t a i j ∥ e i − e j ∥ 2 L_p=\frac{1}{n_s} \sum_{v_i,v_j \in V^s} a_{ij} \Vert e_i-e_j \Vert^2 + \frac{1}{n_t} \sum_{v_i,v_j \in V^t} a_{ij} \Vert e_i-e_j \Vert^2 Lp=ns1vi,vj∈Vs∑aij∥ei−ej∥2+nt1vi,vj∈Vt∑aij∥ei−ej∥2
为了保证点之间的拓扑近似。通过最小化 L p L_p Lp,越强连接的点,有越相似的节点表达。
记 trainable parameter: θ e = { { W f 1 ( k ) , b f 1 ( k ) , W f 2 ( k ) , b f 2 ( k ) , } k = 1 l f , W c , b c } \theta_{e}=\{ \{ W_{f_1}^{(k)}, b_{f_1}^{(k)}, W_{f_2}^{(k)}, b_{f_2}^{(k)},\}_{k=1}^{l_f}, W_c, b_c \} θe={{Wf1(k),bf1(k),Wf2(k),bf2(k),}k=1lf,Wc,bc}
- node classifier
在 deep network embedding module 的顶层加入节点分类器:
y ^ i = ϕ ( e i W y + b y ) \hat{y}_i = \phi(e_i W_y + b_y) y^i=ϕ(eiWy+by)
如果为 multi-class 问题, ϕ ( ⋅ ) \phi(\cdot) ϕ(⋅)为 softmax 函数;如果为 multi-label 问题, ϕ ( ⋅ ) \phi(\cdot) ϕ(⋅)为 sigmoid 函数。
记 trainable parameter: θ y = { W y , b y } \theta_y=\{ W_y, b_y \} θy={Wy,by}。 - domain discriminator
基本思想 :使用 adversarial domain adaptation 使得学习到的 node representation 是 network invariant。
网络结构: 将 node representation 输入 domain discriminator 中,预测 node 来自哪个 network 中:
h d ( k ) ( e i ) = R e L U ( h d ( k − 1 ) ( e i ) W d ( k ) + b d ( k ) ) h_d^{(k)}(e_i)=ReLU(h_d^{(k-1)} (e_i) W_d^{(k)} +b_d^{(k)} ) hd(k)(ei)=ReLU(hd(k−1)(ei)Wd(k)+bd(k))
d ^ i = s o f t m a x ( h d l d ( e i ) W d ( l d + 1 ) + b d ( l d + 1 ) ) \hat{d}_i=softmax(h_{d}^{l_d} (e_i) W_d^{(l_d+1)} + b_d^{(l_d+1)} ) d^i=softmax(hdld(ei)Wd(ld+1)+bd(ld+1))
其中 h d ( 0 ) ( e i ) = e i h_d^{(0)}(e_i)=e_i hd(0)(ei)=ei, h d ( k ) ( e i ) ∈ R 1 × d ( k ) h_d^{(k)}(e_i) \in R^{1 \times d(k)} hd(k)(ei)∈R1×d(k)。
记 trainable parameter: θ d = { W d ( k ) , b d ( k ) } k = 1 l d + 1 \theta_d=\{ W_d^{(k)}, b_d^{(k)} \}_{k=1}^{l_d+1} θd={Wd(k),bd(k)}k=1ld+1
loss function:
L d = − 1 n s + n t ∑ v i ∈ { V s ∪ V t } ( 1 − d i ) log ( 1 − d i ^ ) + d i log ( d i ^ ) L_d= -\frac{1}{n^s+n^t} \sum_{v_i \in \{ V^s \cup V^t \} }(1-d_i) \log (1-\hat{d_i}) + d_i \log (\hat{d_i}) Ld=−ns+nt1vi∈{Vs∪Vt}∑(1−di)log(1−di^)+dilog(di^)
其中 d i d_i di 为 v i v_i vi 的 ground truth label
d i = { 1 v i ∈ V t 0 v i ∈ V s . d_i=\begin{cases} 1 & v_i \in V^t\\ 0 & v_i \in V^s \end{cases} . di={10vi∈Vtvi∈Vs.
d ^ i \hat{d}_i d^i 为 v i v_i vi 来自 target network 的预测概率。 - Joint Training
min θ e , θ y { L y + p L p + λ max θ d { − L d } } \min_{\theta_e,\theta_y} \{ L_y + p L_p +\lambda \max_{\theta_d} \{ -L_d \} \} θe,θymin{Ly+pLp+λθdmax{−Ld}}
为了可同时更新 embedding module 和 domain discriminator,在 embedding module 和 domain discriminator 间插入一个 Gradient Reverse Layer(GRL)。 GRL 可以将 L d L_d Ld 对于 θ d \theta_d θd 的偏导逆过来并且乘以 λ \lambda λ。
ACDNE 可以被SGD 优化:
θ e = θ e − μ ( ∂ L y ∂ θ e + p ∂ L p ∂ θ e − λ ∂ L d ∂ θ e ) \theta_e = \theta_e- \mu (\frac{\partial L_y}{\partial \theta_e}+p \frac{\partial L_p}{\partial \theta_e}- \lambda \frac{\partial L_d}{\partial \theta_e}) θe=θe−μ(∂θe∂Ly+p∂θe∂Lp−λ∂θe∂Ld)
θ y = θ y − μ ∂ L y ∂ θ y \theta_y= \theta_y- \mu \frac{\partial L_y}{\partial \theta_y} θy=θy−μ∂θy∂Ly
θ d = θ d − μ ∂ L d ∂ θ d \theta_d = \theta_d- \mu \frac{\partial L_d}{\partial \theta_d} θd=θd−μ∂θd∂Ld
训练过程如 Algorithm 1 所示。
实验
数据集 :
- 两个不相交的社交网络 Blog1 & Blog2。
点:人。
边: friendshipxxc
attribute: keywords of self-description
label: its joining group - 引文网络。