Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/XiaShan1227/Graphormer
/ functions
Functions
30 in github.com/XiaShan1227/Graphormer
⨍
Functions
30
◇
Types & classes
8
↓ 13 callers
Method
cprint
(self, text)
parameter.py:41
↓ 5 callers
Method
__init__
:param edge_dim: edge feature matrix number of dimension
layer.py:77
↓ 2 callers
Function
all_pairs_shortest_path
(G)
model.py:50
↓ 2 callers
Method
decrease_to_max_value
限制节点度的最大值
layer.py:45
↓ 1 callers
Function
batched_shortest_path_distance
(data)
model.py:63
↓ 1 callers
Method
compute_a
Query-Key product(normalization)
layer.py:165
↓ 1 callers
Method
dot_product
(self, x1, x2)
layer.py:105
↓ 1 callers
Function
exp_init
实验初始化
main.py:97
↓ 1 callers
Function
floyd_warshall_source_to_all
Floyd-Warshall算法查询最短路径(BFS遍历图)
model.py:20
↓ 1 callers
Function
load_ESOL
(args)
data.py:12
↓ 1 callers
Function
parse_args
()
parameter.py:12
↓ 1 callers
Function
shortest_path_distance
(data: Data)
model.py:57
↓ 1 callers
Function
table_printer
绘制参数表格
parameter.py:50
↓ 1 callers
Function
test
测试模型
main.py:65
↓ 1 callers
Function
train
(args, IO, train_loader, num_node_features, num_edge_features)
main.py:18
Method
__init__
:param max_in_degree: max in degree of nodes :param max_out_degree: max out degree of nodes :param node_dim: hidden dimension
layer.py:15
Method
__init__
:param max_path_distance: max pairwise distance between nodes
layer.py:53
Method
__init__
:param dim_in: node feature matrix input number of dimension :param dim_q: query node feature matrix input number dimension :
layer.py:110
Method
__init__
:param num_heads: number of attention heads :param dim_in: node feature matrix input number of dimension :param dim_q: query
layer.py:179
Method
__init__
:param node_dim: node feature matrix input number of dimension :param edge_dim: edge feature matrix input number of dimension
layer.py:215
Method
__init__
(self, path)
parameter.py:38
Method
__init__
:param num_layers: number of Graphormer layers :param input_node_dim: input dimension of node features :param node_dim: hidde
model.py:85
Method
close
(self)
parameter.py:46
Method
forward
:param x: node feature matrix :param edge_index: edge_index of graph (adjacency list) :return: torch.Tensor, node embeddings
layer.py:28
Method
forward
:param x: node feature matrix :param paths: pairwise node paths :return: torch.Tensor, spatial Encoding matrix
layer.py:61
Method
forward
:param x: node feature matrix :param edge_attr: edge feature matrix :param edge_paths: pairwise node paths in edge indexes
layer.py:86
Method
forward
:param query: node feature matrix :param key: node feature matrix :param value: node feature matrix :param edge_attr:
layer.py:125
Method
forward
:param x: node feature matrix :param edge_attr: edge feature matrix :param b: spatial Encoding matrix :param edge_pat
layer.py:193
Method
forward
h′(l) = MHA(LN(h(l−1))) + h(l−1) h(l) = FFN(LN(h′(l))) + h′(l) :param x: node feature matrix :param edge_attr: edge
layer.py:239
Method
forward
:param data: input graph of batch of graphs :return: torch.Tensor, output node embeddings
model.py:134