Learning to Represent the Evolution of Dynamic Graphs withRecurrent Models

摘要

学习图的拓扑结构外,还关注于学习时间信息。提出了一种动态图的无监督表示学习体系结构,旨在学习随时间演化的图的拓扑和时间特征。该方法由嵌入门控图神经网络(GGNNs)和长短时记忆网络(LSTM)的序列-序列编解码器模型组成。GGNN能够在每个时间步学习图的拓扑结构,而LSTM则用于在时间步之间传播时间信息。此外,编码器学习进化图的时间动态,解码器使用编码器提供的编码表示在相同的时间段重建动态。

相关工作

静态图

动态图

节点的表示学习。37-32-16-15-42-5-38

问题定义

动态图定义。初始节点表示由邻接矩阵表示。专注处理无向图的图嵌入。

序言和注释

GGNN,LSTM.Sequence-to-sequence.

动态图的递归模型

GGNN用于在每个时间步对图形拓扑进行建模,更具体地说是为编码器提供输入。编码器的循环结构允许我们使用时间步历史HG的隐藏表示和时间步t的图形拓扑嵌入Gt。

DyGGNN:该模型包括三个主要组件:1)一个GGNN,用于捕获时间步长t处的图形拓扑;2)一个编码器,用于将图形在时间步长窗口上的演化投影到ak维空间;3)一个解码器,用于使用隐藏表示在每个时间步长处重建动态图形的结构。图1显示了我们的动态图在时间步长上的表示学习方法的体系结构。

GGNN通过考虑Gt在时间步长t处的拓扑结构,为Gt构建一个图表示。

我们使用LSTM编码器将Gt投影到一个隐藏表示中,通过大小为w的观察窗口传递动态图形Hg的信息,并使用过去w个时间步的图形拓扑知识计算动态嵌入Gt。

 

 将这个称为图的动态嵌入。解码器LSTM-dec的主要目标是在大小为w的观察窗口中重建图形HGT的历史。解码器作为一个自回归模型,在给定最近在前一时间步预测的图的情况下,在时间步t预测图的拓扑。解码器使用henc T初始化其第一个隐藏状态。图的边集是解码器在每个时间步的预测。

 训练

  O是时间窗口,大小为w。 

注意时间窗口大小w的选择。动态图G,它是一个图快照序列,我们需要考虑节点隐藏状态的序列。我们不能独立地考虑节点的序列,因为我们需要考虑图的时间和拓扑结构。使用滑动观察窗,我们将动态图分解为多个动态图。将连续窗口组合在一起,形成一个小批量(算法1)。通过这种方式,我们不仅保留了每个窗口的时间依赖性,而且还捕获了顺序窗口之间的隐式关系,因为模型参数是在考虑整个小批量输入数据的情况下更新的。

 数据集

基础方法

超参数

结果

动态性很重要,在嵌入方法中加入时间信息可以改进图形表示。

模型分析

图的动态表示的使得模型的精确性由于静态表示的。与静态表示相比,通过时间对模型进行训练可以显著提高动态嵌入的性能。

结论

我们提出了一种在动态环境下对整个图进行表示学习的有效方法。我们在一个真实的动物行为数据集中评估了我们的方法,结果表明,与在静态环境中学习图形表示的最先进模型相比,我们的模型取得了显著更好的性能。有前途的结果证实了我们的方法作为动态图形分析的坚实基础。

Alright, I understand your requirements. Here's a Python program that satisfies your specifications: ```python import queue # Define the 5x5 boolean two-dimensional array to represent the connectivity of the graphs graph = [ [False, True, False, True, False], [True, False, True, False, True], [False, True, False, True, False], [True, False, True, False, True], [False, True, False, True, False], ] # Define the depth first traversal function def depth_first_traversal(graph, start): visited = [False] * len(graph) stack = [start] while stack: vertex = stack.pop() if not visited[vertex]: print(vertex, end=" ") visited[vertex] = True for i in range(len(graph)): if graph[vertex][i] and not visited[i]: stack.append(i) # Define the breadth first traversal function def breadth_first_traversal(graph, start): visited = [False] * len(graph) q = queue.Queue() q.put(start) while not q.empty(): vertex = q.get() if not visited[vertex]: print(vertex, end=" ") visited[vertex] = True for i in range(len(graph)): if graph[vertex][i] and not visited[i]: q.put(i) # Choose a reasonable starting position for the traversal based on the connectivity of the graph start = 0 for i in range(len(graph)): if sum(graph[i]) > sum(graph[start]): start = i # Perform depth first traversal print("Depth First Traversal:") depth_first_traversal(graph, start) # Perform breadth first traversal print("\nBreadth First Traversal:") breadth_first_traversal(graph, start) ``` In this program, we first define the 5x5 boolean two-dimensional array `graph` to represent the connectivity of the graphs that need to be traversed. Then, we define the `depth_first_traversal` function and the `breadth_first_traversal` function to perform depth first and breadth first traversal of the graph respectively. Next, we choose a reasonable starting position for the traversal based on the connectivity of the graph. We do this by iterating over each vertex in the graph and comparing the number of its neighbors to the number of neighbors of the current starting vertex. We choose the vertex with the highest number of neighbors as the starting position. Finally, we call the `depth_first_traversal` function and the `breadth_first_traversal` function with the `graph` and `start` arguments to perform the traversals. The output of the program will be the sequence of vertices visited during the traversals.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值