【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](4)
【論文閱讀】A Gentle Introduction to Graph Neural Networks [圖神經網絡入門](4)
The challenges of using graphs in machine learning
圖在機器學習中的應用挑戰
So, how do we go about solving these different graph tasks with neural networks? The first step is to think about how we will represent graphs to be compatible with neural networks.
那么,我們如何用神經網絡來解決這些不同的圖的預測任務呢?第一步是考慮如何表示與神經網絡兼容的圖。
Machine learning models typically take rectangular or grid-like arrays as input. So, it’s not immediately intuitive how to represent them in a format that is compatible with deep learning. Graphs have up to four types of information that we will potentially want to use to make predictions: nodes, edges, global-context and connectivity. The first three are relatively straightforward: for example, with nodes we can form a node feature matrix NNN by assigning each node an index iii and storing the feature for nodeinode_inodei? in NNN. While these matrices have a variable number of examples, they can be processed without any special techniques.
機器學習模型通常采用矩形或網格狀array作為輸入。因此,如何用一種與深度學習兼容的格式來表示它們并不是一種直觀的方法。圖有多達四種類型的信息,我們可能希望使用它們來進行預測:節點、邊、全局上下文和連通性。前三個相對簡單: 例如,對于節點,我們可以為每個節點分配一個索引iii,并將nodeinode_inodei?的特征存儲在NNN中,從而形成一個節點特征矩陣NNN。雖然這些矩陣的示例數量是可變的,但它們無需任何特殊技術就可以處理。
However, representing a graph’s connectivity is more complicated. Perhaps the most obvious choice would be to use an adjacency matrix, since this is easily tensorisable. However, this representation has a few drawbacks. From the example dataset table, we see the number of nodes in a graph can be on the order of millions, and the number of edges per node can be highly variable. Often, this leads to very sparse adjacency matrices, which are space-inefficient.
然而,表示圖的連通性要復雜得多。也許最明智的選擇是使用鄰接矩陣來表示圖的連通性,因為它很容易被表示為張量。但是,這種表示方式有一些缺點。從示例數據集表中,我們可以看到圖中的節點數可以達到數百萬的量級,每個節點的邊數可以是高度可變的。這通常會導致非常稀疏的鄰接矩陣,這使得空間的存儲效率很低。
Another problem is that there are many adjacency matrices that can encode the same connectivity, and there is no guarantee that these different matrices would produce the same result in a deep neural network (that is to say, they are not permutation invariant).
另一個問題是,有許多鄰接矩陣在編碼后具有相同的連通性,并且不能保證這些不同的矩陣會在深度神經網絡中產生相同的結果(也就是說,它們不是置換不變的)。
Learning permutation invariant operations is an area of recent research.[16] [17]
學習置換不變運算是最近研究的一個領域。[16] [17]
For example, the Othello graph from before can be described equivalently with these two adjacency matrices. It can also be described with every other possible permutation of the nodes.
例如,前面的奧賽羅圖可以用以下這兩個鄰接矩陣等價地描述。它也可以用所有其他可能的節點排列來描述。
The example below shows every adjacency matrix that can describe this small graph of 4 nodes. This is already a significant number of adjacency matrices–for larger examples like Othello, the number is untenable.
下面的例子展示了每個可以描述這個4個節點的小圖的鄰接矩陣。這已經是相當多的鄰接矩陣了——對于更大的例子,如Othello,這個數字是站不住腳的。
One elegant and memory-efficient way of representing sparse matrices is as adjacency lists. These describe the connectivity of edge eke_kek? between nodes nin_ini? and njn_jnj? as a tuple (i,j) in the k-th entry of an adjacency list. Since we expect the number of edges to be much lower than the number of entries for an adjacency matrix (nnodes2)(n_{nodes}^2)(nnodes2?), we avoid computation and storage on the disconnected parts of the graph.
使用鄰接表是表示稀疏矩陣的一種簡潔且內存效率較高的方法。它們將節點nin_ini?和njn_jnj?之間的邊eke_kek?的連通性描述為鄰接表第k個條目中的一個元組(i,j)。由于我們期望邊的數量比鄰接矩陣(nnodes2)(n_{nodes}^2)(nnodes2?)的條目數量要少得多,所以我們避免了在圖的非連通部分上的計算和存儲。
Another way of stating this is with Big-O notation, it is preferable to have O(nedges)O(n_{edges})O(nedges?), rather than O(nnodes2)O(n_{nodes}^2)O(nnodes2?).
另一種表述方式是用大寫O符號,最好是O(nedges)O(n_{edges})O(nedges?),而不是O(nnodes2)O(n_{nodes}^2)O(nnodes2?)。
To make this notion concrete, we can see how information in different graphs might be represented under this specification:
為了使這個概念更具體,我們可以看到不同圖表中的信息在這個規則下是如何表示的:
Hover and click on the edges, nodes, and global graph marker to view and change attribute representations. On one side we have a small graph and on the other the information of the graph in a tensor representation.
將鼠標懸停并單擊邊緣、節點和全局圖形標記來查看和更改屬性表示。一邊是一個小圖,另一邊是張量表示的圖的信息。
It should be noted that the figure uses scalar values per node/edge/global, but most practical tensor representations have vectors per graph attribute. Instead of a node tensor of size [nnodes][n_{nodes}][nnodes?] we will be dealing with node tensors of size [nnodes,nodedim][n_{nodes}, node_{dim}][nnodes?,nodedim?]. Same for the other graph attributes.
值得注意的是,圖在每個節點/邊/全局中使用標量值,但是大多數實際的張量表示在每個圖屬性中都有向量。我們將處理大小為[nnodes,nodedim][n_{nodes}, node_{dim}][nnodes?,nodedim?]的結點張量,而不是[nnodes][n_{nodes}][nnodes?]的結點張量。其他圖屬性也是如此。
參考文獻
[16] Learning Latent Permutations with Gumbel-Sinkhorn Networks Mena, G., Belanger, D., Linderman, S. and Snoek, J., 2018.
[17] Janossy Pooling: Learning Deep Permutation-Invariant Functions for Variable-Size Inputs Murphy, R.L., Srinivasan, B., Rao, V. and Ribeiro, B., 2018.
總結
以上是生活随笔為你收集整理的【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](4)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 科技巨头的最后通牒 Meta:加大个人产
- 下一篇: 【论文阅读】A Gentle Intro