[论文精读]Do Transformers Really Perform Bad for Graph Representation?

news/发布时间2024/5/14 19:19:56

论文网址:[2106.05234] Do Transformers Really Perform Bad for Graph Representation? (arxiv.org)

论文代码:https://github.com/Microsoft/Graphormer

英文是纯手打的!论文原文的summarizing and paraphrasing。可能会出现难以避免的拼写错误和语法错误,若有发现欢迎评论指正!文章偏向于笔记,谨慎食用!

1. 省流版

1.1. 心得

1.2. 论文总结图

2. 论文逐段精读

2.1. Abstract

        ①Transformer did not achieve ideal performance comparing with mainstream GNN variants

        ②The authors put forward Graphormer to change this situation

leaderboard  n. 排行榜;通栏广告

2.2. Introduction

        ①Graphormer performs outstanding on Open Graph Benchmark Large-Scale Challenge (OGB-LSC), and several popular leaderboards such as OGB and Benchmarking-GNN 

        ②Transformer only takes node similarity into consideration, whereas dose not focus on structural relationship. Ergo, Graphormer add structural encoding

        ③They capture node importance by Centrality Encoding, extract centrality by Degree centrality and present structural relationship by Spatial Encoding

        ④Graphormer occupies the top spot on the OGB-LSC, MolHIV, MolPCBA, ZINC and other rankings

de-facto  实际上的:指在实际上拥有某种地位或权力,而不是在法律上或正式上拥有

canonical  adj. 根据教规的,按照宗教法规的;真经的,正经的;标准的,典范的;准确的,权威的;公认的,依据科学法则的;(数学表达式)最简洁的;(与)公理(或标准公式)(有关)的;(与)教会(或教士)(有关)的

2.3. Preliminary

(1)Graph Neural Network (GNN)

        ①Presenting graph as G=\left ( V,E \right ), where V=\{v_{1},v_{2},\cdots,v_{n}\} denotes the node set, n=\left | V \right | denotes the number of nodes. Define the feature vector of v_i named x_i and node representation of v_i at the l-th layer is h_i^{\left ( l \right )}h_i^{\left ( 0 \right )}=x_i

        ②The usual GNN is representated as:

a_i^{(l)}=\text{AGGREGATE}^{(l)}\left(\left\{h_j^{(l-1)}:j\in\mathcal{N}(v_i)\right\}\right)\\\quad h_i^{(l)}=\text{COMBINE}^{(l)}\left(h_i^{(l-1)},a_i^{(l)}\right)\\h_G=\text{READOUT}\left(\left\{h_i^{(L)}\mid v_i\in G\right\}\right)

where \mathcal{N}(v_i) denotes the neighbors (unknow hops) of v_i

(2)Transformer

        ①Each layer in Transformer contains a self-attention module and a position-wise feed-forward network (FFN)

        ②The input of self-attention module is {H}=\left[h_{1}^{\top},\cdots,h_{n}^{\top}\right]^{\top}\in\mathbb{R}^{n\times d}, where d represents the hidden dimension, h_{i}\in\mathbb{R}^{1\times d} denotes the hidden representation at position i

        ③The function of attention mechanism:

\begin{aligned}Q&=HW_Q,W_{Q}\in\mathbb{R}^{d\times d_{K}} \quad K=HW_K,W_{K}\in\mathbb{R}^{d\times d_{K}} \quad V=HW_V,W_{V}\in\mathbb{R}^{d\times d_{V}} \\A&=\frac{QK^\top}{\sqrt{d_K}},\quad\mathrm{Attn}\left(H\right)=\mathrm{softmax}\left(A\right)V\end{aligned}

where A is a similarity matrix of queries and keys

        ④They apply simple single-head self-attention mechanism and define d_K=d_V=d. Moreover, they eliminate bias in multi-head attenton part

2.4. Graphormer

2.4.1. Structural Encodings in Graphormer

        The overall framework of Graphormer, which contains three modules:

(1)Centrality Encoding

        ①For directed graph, their centrality encoding for input will be:

h_{i}^{(0)}=x_{i}+z_{\deg^{-}(v_{i})}^{-}+z_{\deg^{+}(v_{i})}^{+}

where z_{\deg^{-}(v_{i})}^{-}\in \mathbb{R}^d is the learnable embedding vector of indegree \deg^{-}(v_{i})z_{\deg^{+}(v_{i})}^{+}\in \mathbb{R}^d is the learnable embedding vector of outdegree \deg^{+}(v_{i})呃呃我现在不太能想象z是个什么样的玩意儿

        ②For undirected graph, just one \deg(v_{i}) replaces \deg^{+}(v_{i}) and \deg^{-}(v_{i})

(2)Spatial Encoding

        ①There is no sequence in graph presentation. To this end, they provide a new spatial encoding method to present spatial relations between v_i and v_j:

{\phi\left(v_{i},v_{j}\right):V\times V\rightarrow\mathbb{R}}

where \phi\left(v_{i},v_{j}\right) they choose there is the shortest path (SPD). If there is no path, then set value as -1.

        ②⭐Assigning a learnable scalar to each feasible output value as bias term in self-attention part(鼠鼠注意力学得太菜了捏

        ③The Q-K product matrix A can be calculated by:

A_{ij}=\frac{(h_iW_Q)(h_jW_K)^T}{\sqrt{d}}+b_{\phi(v_i,v_j)}

where b_{\phi(v_i,v_j)} denotes learnable scalar

        ④Paraphrase不动了这里上一句中文,文中的意思大概是上式比起传统的GNN可以体现全局视野,每个节点都开天眼。然后还能体现一下学习性,作者举例说如果b_{\phi(v_i,v_j)}\phi\left(v_{i},v_{j}\right)负相关的话可能每个节点会更在意邻近节点。

(3)Edge Encoding in the Attention

        ①In the previous works, adding edge features into corresponding node features or adding edge features and aggregated node features into corresponding node features are two traditional edge encoding methods. However, it is too superficial and limited in that it can just express the adjacent relationships rather than global relationships.

        ②The SP of each pair node can be SP_{ij}=\left ( e_1,e_2,...,e_N \right )

        ③They calculate the average of the dot-products of the edge feature x_{e_{n}} in the n-th edge e_n and a learnable embedding weight w_{n}^{E}\in\mathbb{R}^{d_{E}} in the n-th along the path:

c_{ij}=\frac{1}{N}\sum_{n=1}^{N}x_{e_{n}}(w_{n}^{E})^{T}

where d_E denotes the dimensionality of edge feature

2.4.2. Implementation Details of Graphormer

(1)Graphormer Layer

(2)Special Node

2.4.3. How Powerful is Graphormer?

(1)Fact 1

(2)Fact 2

2.5. Experiments

2.5.1. OGB Large-Scale Challenge

(1)Baselines

(2)Settings

(3)Results

2.5.2. Graph Representation

(1)Baselines

(2)Settings

(3)Results

2.5.3. Ablation Studies

(1)Node Relation Encoding

(2)Centrality Encoding

(3)Edge Encoding

2.6. Related Work

2.6.1. Graph Transformer

2.6.2. Structural Encodings in GNNs

(1)Path and Distance in GNNs

(2)Positional Encoding in Transformer on Graph

(3)Edge Feature

2.7. Conclusion

2.8. Proofs

2.8.1. SPD can Be Used to Improve WL-Test

2.8.2. Proof of Fact 1

2.8.3. Proof of Fact 2

2.9. Experiment Details

2.9.1. Details of Datasets

2.9.2. Details of Training Strategies

(1)PCQM4M-LSC

(2)OGBG-MolPCBA

(3)OGBG-MolHIV

(4)ZINC

2.9.3. Details of Hyper-parameters for Baseline Methods

(1)PCQM4M-LSC

(2)OGBG-MolPCBA

(3)OGBG-MolHIV

2.10. More Experiments

2.11. Discussion & Future Work

3. 知识补充

3.1. Permutation invariant

参考学习1:【神经网络】Deep Sets:满足置换不变性(permutation-invariant)与置换同变性(permutation-equivariant)的通用网络结构 - 知乎 (zhihu.com)

4. Reference List

Ying C. et al. (2021) 'Do Transformers Really Perform Bad for Graph Representation?', NeurIPS 2021. doi: https://doi.org/10.48550/arXiv.2106.05234

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.bcls.cn/WGpp/2352.shtml

如若内容造成侵权/违法违规/事实不符,请联系编程老四网进行投诉反馈email:xxxxxxxx@qq.com,一经查实,立即删除!

相关文章

几个常见的C/C++语言冷知识

当涉及到C/C语言时,有一些冷知识可能并不为人所熟知,但却可以让你更深入地理解这门古老而强大的编程语言。以下是一些有趣的C/C语言冷知识。 1. 数组的下标可以是负数 在我们日常的C语言编程中,数组是一个非常常见的数据结构。我们习惯性地使…

【C语言】深度探讨文件操作(一)

文章目录 📝前言🌠 为什么使用文件?🌉什么是文件? 🌠程序文件🌉数据文件 🌠文件名🌉二进制文件和文本文件? 🌠文件的打开和关闭🌉 流和…

FPS游戏漫谈弱网环境时延优化

游戏在弱网情况下会变得体验很差,玩家的直观感受就是我的操作怎么没有反应,整个游戏世界都是一卡一顿的。这个就是因为网络问题导致了游戏体验变差。 那什么是弱网环境?弱网环境就是指网络不好的环境,尤其是移动网络下&#xff0…

edge安装fdm插件

下载 https://www.crxsoso.com/webstore/detail/ahmpjcflkgiildlgicmcieglgoilbfdp 安装 进入edge插件管理页面 edge://extensions/2. 将下载的crt文件拖到这个页面,就能自动安装了 在其他网页不能安装,会变成下载。

压缩感知常用的测量矩阵

测量矩阵的基本概念 在压缩感知(Compressed Sensing,CS)理论中,测量矩阵(也称为采样矩阵)是实现信号压缩采样的关键工具。它是一个通常为非方阵的矩阵,用于将信号从高维空间映射到低维空间&…

calcite在flink中的二次开发,介绍解析器与优化器

calcite 在flink中的二次开发 1 CodeGen2 flink 语法扩展2.1 在进行 Rule 规则匹配时,放开对 Distinct 的限制2.2下面附上一个 利用codegen来生成所需类的例子: 3 flink使用calcite 生成解析器FlinkSqlParserImpl3.1 FlinkSqlParserImpl 的生成3.1.1 fli…

尝试一下最新的联合办公利器ONLYOffice

下载下来一起试试吧 桌面安装版下载地址:https://www.onlyoffice.com/zh/download-desktop.aspx) 官网地址:https://www.onlyoffice.com 普通Office对联合办公的局限性 普通Office软件(如Microsoft Office、Google Docs等)在面对…

shell脚本实现菜单案例......

系统命令: $REPLY : 当没有参数变量提供给read命令的时候,这个变量会作为默认变量提供给read命令 1.select命令写菜单 #!/bin/bash PS3"please input your choice>>>:" select MENU in {A..E};docase $REPLY inA)date;;B)pwd;;C)who…

OpenCV-42 直方图均匀化

目录 一、直方图均匀化原理 二、直方图均匀化在OpenCV中的运用 一、直方图均匀化原理 直方图均匀化是通过拉伸像素强度的分布范围,使得在0~255灰阶上的分布更加均匀,提高图像的对比度。达到改善图像主管视觉效果的目的。对比度较低的图像适合使用直方…

Adobe将类ChatGPT集成到PDF中

2月21日,全球多媒体巨头Adobe在官网宣布,推出生成式AI助手AI Assistant,并将其集成在Reader 和Acrobat 两款PDF阅读器中。 据悉,AI Assistant的功能与ChatGPT相似,可以基于PDF文档提供摘要、核心见解、基于文档内容&a…

爬虫学习笔记-scrapy爬取当当网

1.终端运行scrapy startproject scrapy_dangdang,创建项目 2.接口查找 3.cd 100个案例/Scrapy/scrapy_dangdang/scrapy_dangdang/spiders 到文件夹下,创建爬虫程序 4.items定义ScrapyDangdangItem的数据结构(要爬取的数据)src,name,price 5.爬取src,name,price数据 导入item…

IDEA2023.3.4开启SpringBoot项目的热部署【简单明了4步操作】

添加devtools依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope><optional>true</optional> </dependency>IDEA开启自动编译 …

STM32 学习2 库函数控制GPIO输出

STM32 学习2 库函数控制GPIO输出 一、GPIO寄存器介绍1. GPIO简介2. GPIO功能&#xff08;1&#xff09;模式分类&#xff08;2&#xff09;模式设置方法MODE[1:0]&#xff1a;模式控制&#xff0c;用于配置端口引脚的模式&#xff1a;CNF[1:0]&#xff1a;配置引脚输出速度&…

Gitee教程2(完整流程)

1.配置git git config --global user.name "用户名" git config --global user.email "密码" 如何获取&#xff1f; gitee右上角加号点击新建仓库&#xff0c;仓库名随便起一个就行 找到这条命令&#xff0c;把这两句一个一个复制到vscode终端就行 2.创建g…

【Python Scrapy】分布式爬虫利器

在当今信息爆炸的时代&#xff0c;获取大规模数据对于许多应用至关重要。而分布式爬虫作为一种强大的工具&#xff0c;在处理大量数据采集和高效爬取方面展现了卓越的能力。 本文将深入探讨分布式爬虫的实际应用场景&#xff0c;通过代码示例演示其在提升爬取效率、保障系统稳定…

stm32和嵌入式linux可以同步学习吗?

在开始前我有一些资料&#xff0c;是我根据网友给的问题精心整理了一份「stm3的资料从专业入门到高级教程」&#xff0c; 点个关注在评论区回复“888”之后私信回复“888”&#xff0c;全部无偿共享给大家&#xff01;&#xff01;&#xff01;如果需要使用STM32&#xff0c;建…

成都力寰璨泓科技有限公司抖音小店品质保障

在数字化浪潮席卷全球的今天&#xff0c;网络购物已成为人们日常生活的重要组成部分。抖音小店作为新兴的电商平台&#xff0c;凭借其独特的社交属性和个性化推荐机制&#xff0c;吸引了众多消费者的目光。在众多抖音小店中&#xff0c;成都力寰璨泓科技有限公司的店铺以其卓越…

(12)ATF BL31中断

欢迎关注“安全有理”微信公众号。 概述 系统在运行过程中的任何阶段&#xff0c;都有可能产生中断。在Armv8架构系统中&#xff0c;TEE-OS运行在安全世界的EL1&#xff0c;Rich-OS运行在非安全世界的EL1&#xff0c;而BL31则运行于EL3。想实现各种中断在三种状态下被处理的统…

一、初始 Vue

1、Vue 1.1 Vue简介 1.1.1 Vue.js 是什么 Vue (读音 /vjuː/&#xff0c;类似于 view) 是一套用于构建用户界面的渐进式框架。与其它大型框架不同的是&#xff0c;Vue 被设计为可以自底向上逐层应用。Vue 的核心库只关注视图层&#xff0c;不仅易于上手&#xff0c;还便于与第…

【Redis】Redis的数据分布算法

一共有五种算法&#xff0c;分别为&#xff1a;哈希算法、一致性哈希算法、带有限负载的一致性哈希算法、虚拟节点一致性哈希算法、虚拟槽分区 哈希算法 思想&#xff1a;根据某个key的值或者key 的哈希值与当前可用的 master 节点数取模&#xff0c;根据取模的值获取具体的服…
推荐文章