目的:理解並解析graph embedding 與adversarial graph alignment的公式。
目錄
一、Unsupervised graph embedding無監督圖嵌入
1.3 Unsupervised graph embedding無監督圖嵌入
2.2 有監督圖對齊supervised graph alignemnt
三、domain Adversarial training圖對抗生成
一、Unsupervised graph embedding無監督圖嵌入
1.1 graph embedding圖嵌入
https://blog.csdn.net/lkxhit/article/details/81391728 Graph Embedding 綜述
圖Graph:圖是一種抽象程度高、表達能力強的數據結構,它通過對節點和邊的定義來描述實體和實體之間的關聯關係。常用的圖有社交關係網絡、商品網絡、知識圖譜等等。
圖嵌入(Graph Embedding)定義:網絡表示學習又稱圖嵌入(Graph Embedding),主要目的是將一個網絡中的節點基於網絡的特點映射成一個低維度向量,這樣可以定量的衡量節點之間的相似度,更加方便的應用。
Graph Embedding是學術界一個重要研究方向,比如deep walk,是語言模型和無監督學習從單詞序列擴展到圖結構上的一個典型方法,該方法將截斷遊走的序列當成句子進行學習,之後採用word2vec中Skip-Gram模型進行訓練,得到每個節點的embedding向量。Line只針對邊進行採樣,Node2vec可以調節參數來進行BFS或者DFS的抽樣。
所以Graph Embedding的基本思路是,對graph進行採樣(Sampling),採出來的序構建模型(Embedding)。
1.2 圖對齊Graph alignment問題描述
圖的公式表示:
- 用G表示一個圖,G=(V,E)
- V表示圖中的節點
- E表示邊,就是節點與節點之間的連接 E⊆ ( VxV)
- n = |V |表示節點的個數爲n
- 也有將圖表示爲 G = (V,E,X),其中X爲節點的特徵,n×m維度,n表示節點的個數,m表示每個節點的特徵維度
Graph alignment:
- 兩個Graph,一個源域,一個目標域,可以分別用Gs和Gt表示。
- Gs=(Vs, Es)表示源域圖
- Gt=(Vt, Et)表示目標域圖
- graph alignment表示將Gs與Gt中的節點對應起來。
1.3 Unsupervised graph embedding無監督圖嵌入
有較多的graph embedding的方法,例如,DeepWalk,Line,Node2Vec
[23] B. Perozzi, R. Al-Rfou, and S. Skiena, “Deepwalk: Online learningof social representations,” in Proceedings of the 20th ACM SIGKDDinternational conference on Knowledge discovery and data mining,pp. 701–710, ACM, 2014.
[24] J. Tang, M. Qu, M. Wang, M. Zhang, J. Yan, and Q. Mei, “Line:Large-scale information network embedding,” in Proceedings of the 24th International Conference on World Wide Web, pp. 1067–1077,International World Wide Web Conferences Steering Committee, 2015.
[25] A. Grover and J. Leskovec, “node2vec: Scalable feature learning for networks,” in Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855–864, ACM, 2016.
例如Deep walk就是一種Unsupervised graph embedding 的方法,它基於隨機遊走Random-Walk-based Methods
論文:DeepWalk: Online Learning of Social Representations http://www.perozzi.net/publications/14_kdd_deepwalk.pdf \
PPT: http://www.perozzi.net/publications/14_kdd_deepwalk-slides.pdf
工具包:https://github.com/phanein/deepwalk
DeepWalk是一種基於隨機遊走的Graph embedding的方法。
表示d維度的特徵向量。其中|V|表示節點的個數,每個節點表示爲一個d維的向量。
Unsupervised graph embedding就是需要通過每個圖中的節點vi學到特徵
1.4 DeepWalk方法
DeepWalk, inspired by Word2Vec [26], borrows the methodology of Skip-grams [27] for training
[26] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean,“Distributed representations of words and phrases and their composition-ality,” in Advances in neural information processing systems, pp. 3111–3119, 2013.
[27] T. Mikolov, K. Chen, G. Corrado, and J. Dean, “Efficient estimation ofword representations in vector space,” arXiv preprint arXiv:1301.3781,2013.
Skip-grams 的word窗口
- 對於每個word 表示爲
- 對於每個表示爲一個window,k爲半個window的寬度
- window爲:
模型爲了學出已知當前word和當前window的最大化概率的方法。
DeepWalk方法
即已知word與window,最有可能的映射。
- w爲window的size
- Φ是mapping function即映射關係
- 映射爲graph中所有的節點到節點的feature的映射關係
二、graph alignment圖對齊
2.1 圖對齊Graph alignment問題描述
圖的公式表示:
- 用G表示一個圖,G=(V,E)
- V表示圖中的節點
- E表示邊,就是節點與節點之間的連接 E⊆ ( VxV)
Graph alignment:
- 兩個Graph,一個源域,一個目標域,可以分別用Gs和Gt表示。
- Gs=(Vs, Es)表示源域圖
- Gt=(Vt, Et)表示目標域圖
- graph alignment表示將Gs與Gt中的節點對應起來。
2.2 有監督圖對齊supervised graph alignemnt
問題轉換:圖對齊Graph alignment——圖中節點對齊V alignment——圖中節點經過embedding得到V對齊——源域與目標域Z映射後接近——arg min ||WX-Y||
從前面graph embedding分別得出兩個set
- Zs爲n個source domain的Graph節點的特徵,Zt爲m個target domain的graph節點的特徵
我們希望每個source與target domian中的節點能夠對應,即對應節點的特徵z對應
- 即對應的第i個節點,在源域和目標域中的特徵對應
- 網絡需要學出一個線性的映射W讓特徵對應上
- 公式表示對應域內對應節點的特徵經過W轉換後最接近時候的W即爲所需要的W
- 源域X的特徵經過映射,與Y最接近時候的W即爲所需要的W
- W爲d×d維度的矩陣,源域爲X,目標域爲Y
三、domain Adversarial training圖對抗生成
將GAN引入圖結構之中。最終的目的是使源域的與目標域的難以區分。
- W可以看作生成器
- 判別器用於判別源域的與目標域的
- 運用GAN的思想使源域的與目標域的接近
判別器D
對於給定的W,其參數爲,希望判別器儘可能的判別出目標域與源域樣本
- 其中爲源域樣本經過生成器後生成的樣本
- 目標域樣本爲
- 表示判別器儘可能的判別出源域樣本,反之亦然
生成器W
生成器W需要儘可能的愚弄判別器
與上面類似。
經過類似於GAN的過程,W即儘可能的將源域圖像拉近目標域。