GNN-CS224W: 1-2 Introduction; Traditional Methods for machine learning in Graphs

图神经网络(GNN)在处理复杂网络数据方面展现出强大的能力,从节点属性预测到图生成,涵盖节点级别、边级别、社区级别以及图级别任务。GNN通过学习节点特征和拓扑结构,捕捉网络中的局部和全局信息。在药物发现、社交网络分析、蛋白质相互作用预测等领域有广泛应用。然而,图数据的异质性、规模和动态性带来挑战,如高效存储、计算复杂性和模型解释性。未来的研究将聚焦于解决这些挑战,进一步提升GNN在复杂网络分析中的效能。

network相比其他的数据有很多特点让它难以处理:

arbitrary size and complex topological structure

Applications of Graph ML

task level

Node-level

Predict a property of a node
Example: Categorize online users / items

Alpha Fold

task: Computationally predict a protein’s 3D structure based solely on its amino acid(氨基酸) sequence

Key idea: “Spatial graph” (represent the underlying protein as a graph)
Nodes: Amino acids in a protein sequence
Edges: Proximity between amino acids (residues) (在空间中接近的node之间构建边)

模型:给定Amino acids的位置及edges proximities between them 然后预测新的Amino acids的位置(还是 Amino acids的新位置),从而最终预测amino acids的位置和protein的最终形态

Edge-level

Predict whether there are missing links between two nodes
Example: Knowledge graph completion

Recommender system

Node: users, items(songs, merchandise…)
Edge: user-item interactions
Goal: recommend items user might like

Drug side effects–Biomedical graph link prediction

有的人可能会吃多种药,目的是预测不同种类的药物同时服用时的副作用
药物太多,导致不可能对所有药物组合试验其副作用,所以采用机器学习来预测

Task: Given a pair of drugs predict adverse side effects
Nodes: Drugs & Proteins
Edges: Interactions between drugs and proteins, Interactions between proteins, Interactions between drugs (drugs之间的interaction代表adverse side effects)
node之间的edge有的是知道的,用模型来预测missing edges

Community (subgraph) level

Detect if nodes form a community(团体)
Example: Social circle detection
相当于cluster,找出社交网络中联系紧密的小团体

Traffic prediction

road network as a graph
Node: Road segments
Edge: connection between road segments
task: 给出从一个node到另一个node的路线

Graph-level

Categorize different graphs
Example: Molecule property prediction

Drug discover

Antibiotics(抗生素) are small molecular graphs
Nodes: Atoms
Edges: Chemical bonds(化学键)
Task: 预测一个分子是否有能被当做药物

原子组合成的分子太多了,无法做到所有的都做药物试验,所以需要机器学习来预测更有可能有用的分子

Graph generation – Drug discovery

还是将原子作为node,化学键作为edges
User case 1: Generate novel molecules with high drug likeness
Use case 2: Optimize existing molecules to have desirable properties (把已有的分子碎片扩展成有特定作用的大分子)

Graph evolution – Physical simulation

Physical simulation as a graph
Nodes: Particles
Edges: Interaction between particles
Task: 预测这些particles将来的状态

Choice of graph representation, how do we define a graph?

the choice of what the nodes are and what the links are are very important.

同样的数据可以选择很多不同的对象作为node和link,node和link的选择对模型效果很重要

Objects: nodes, vertices N
Interactions: links, edges E
System: network, graph G(N,E)

Directed and Undirected Graph

Undirected Graph

node之间的关系是 symmetrical(对称的), reciprocal(相互的)

Examples: Collaborations, Friendship on Facebook

Directed Graph

every link has a direction, a source, a destination
Examples: Phone calls, Following on Twitter

Node degrees

Node degree: kik_iki the number of edges adjacent to node i, (包括入度和出度)例如ki=4k_i=4ki=4
Average degree: 1N∑i=1Nki=2EN\frac{1}{N}\sum\limits^{N}_{i=1}k_i=\frac{2E}{N}N1i=1Nki=N2E

directed graph node has In degree and Out degree

Bipartite graph

在这里插入图片描述
如图所示,满足如下特性:

  1. all nodes can be divided into two disjoint(不相交) set U and V
  2. every link connects a node in U to one in V
  3. U and V are independent set

Examples:
§ Authors-to-Papers (they authored)
§ Actors-to-Movies (they appeared in)

Folded/Projected Bipartite graph

在这里插入图片描述
如上图所示,Bipartite graph可以将一边fold起来,fold后graph中的边表示两个node是否可以通过另一边的node连通
假设上图中表示的是author和paper的关系,左边黄点表示author,右边方块便是paper,则根据没有fold的bipartite graph可知,1 2 3三位作者合作了paper A,则1 2 3在fold后的图里是连通的,2和5合作了paper B,则2和5在fold后的图里是连通的。另一边也可以用同样的逻辑fold起来。

Representing graphs

Adjacent matrix

在这里插入图片描述
在这里插入图片描述

Most real-world networks are sparse, 这导致了 Adjacent matrix 也sparse
例如人们的社交网络,世界上一共有70亿人,但是一个人只能跟很少一部分建立关系,剩余大量的人都没有关系

Edge list

在这里插入图片描述

将graph表示为一个二维的matrix

缺点是不能做任何graph manipulation和analysis of the graph

Adjacency list

在这里插入图片描述
优点:

  1. 支持 graph manipulation和analysis of the graph
  2. 相比adjacent matrix存储空间大大减少
    可以二维矩阵来存储,因为边很少,所以列数会较小

Node, edge and graph attributes

Possible options:

  1. Weight (e.g., frequency of communication)
    weight可以直接体现在adjacent matrix上
  2. Ranking (best friend, second best friend…)
  3. Type (friend, relative, co-worker)
  4. Sign: Friend vs. Foe, Trust vs. Distrust
  5. Properties depending on the structure of the rest of the graph: Number of common friends

more types of graphs

  1. self-edges
    节点有从自己出发、指向自己的边,体现在adjacent matrix上就是对角线元素为1
  2. multigraph
    两个节点之间不只有一条边。有时边含义相同,则可以边的数量可以认为是weight;有时边含义不同,不能认为是weight。

连通图和非连通图

Undirected

连通图和非连通图的差别可以提现在adjacent matrix,如下图
在这里插入图片描述

Directed
  1. Strongly connected directed graph (强连通图)
    has a path from each node to every other node and vice versa (e.g., A-B path and B-A path)
  2. Weakly connected directed graph (弱连通图)
    is connected if we disregard the edge directions
Strongly connected components (SCCs) (强连通分量)

Traditional Methods for machine learning in Graphs

Traditional ML pipeline

  1. Design features for nodes/links/graphs
    node feature: 例如 protein attributes
    例如node在整个network里处于什么位置,node附近的结构是怎样的

    特征可以被分为2种:

    1. network structure
    2. nodes/links/graphs properties
  2. Obtain features for all training data

Node-level tasks and features

Goal: Characterize the structure and position of a node in the network,通常有如下4种特征:

Node degree

Node degree counts the neighboring nodes without capturing their importance.

Node centrality

Node centrality(中心)表示一个node是不是graph的中心,是中心的程度是多少

有如下几种方式

Engienvector(特征向量) centrality

A node vvv is important if surrounded by important neighboring nodes u∈N(v)u\in N(v)uN(v).

node vvv的centrality的计算方式:

cv=1λ∑u∈N(v)cuc_v=\frac{1}{\lambda}\sum\limits_{u\in N(v)}c_ucv=λ1uN(v)cu

其中λ\lambdaλ是一个正的常数,称为eigenvalue(特征值)。上式可以写成matrix form:

λc=Ac\lambda c = Acλc=Ac

其中A为adjacent matrix, c称为为eigenvector

问题
  1. The largest eigenvalue λmax\lambda_{max}λ
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值