# PyG

4개의 포스트

Pytorch Geometric - Message Passing Network

0. Graph Convolution GNN은 CNN과 유사하게 convolution 연산을 수행한다. 다만, 그래프의 불규칙한 구조를 반영할 수 있도록 기존의 1D 또는 2D convolution가 아닌 graph convolution 연산을 사용한다. 아래 그림 출처) Graph convolution 연산의 핵심은 노드를 임베딩함에 있어 엣지로 연결된 노드들, 즉 이웃 노드들의 정보를 활용하는 것이다. 하나의 중심 노드에 대해, 그 노드가 이웃하는 노드들의 정보를 하나로 모아 중심 노드를 표현할 수 있는 벡터로 출력한다. 이러한 과정은 이웃 노드들이 엣지를 따라 중심 노드로 정보를 전달한다는 측면에서 **message passing

2023년 5월 5일
·
0개의 댓글
·
post-thumbnail

Pytorch Geometric 튜토리얼

0. PyG Pytorch Geometric, 줄여서 PyG는 그래프 신경망(GNN)을 쉽게 작성하고 훈련할 수 있도록 PyTorch를 기반으로 구축된 라이브러리다. 그래프 혹은 불규칙한 구조에 대해 여러 논문에서 제안된 딥러닝 기법들로 구성되어 있다. 1. 데이터 1.1. 데이터 핸들링 PyG에서 다루는 데이터는 그래프다. 이에 따라 그래프를 torch_geometric.data.Data 클래스를 통해 데이터 형태로 변환한다. 예를 들어, 그림과 같이 3개의 노드로 구성된 그래프를 PyG에서 정의된 데이터로 변환해보자. 그래프 내의 노드들은 모두 1개의 feature를 갖고 있고, 이들 중 노드 0과 1, 노드 1과 2는 방향성이 없는 엣지로 연결되어 있다. 이러한 정보들을 텐서로 표

2023년 4월 9일
·
0개의 댓글
·
post-thumbnail

[Pytorch Geometric Tutorial] 3. Graph attention networks (GAT) implementation

Pytorch Geometric tutorial: Graph attention networks (GAT) implementation 💡 target node에 대한 neighbor node의 중요도가 모두 같지 않다 → 특별히 더 중요한 노드가 있다고 할 때, 그 weight를 automatic하게 학습하는 방법? ⇒ GAT Graph Attention Layer Input : set of node features $\mathbf{h} = \{\bar{h1},\bar{h2}, \dots ,\bar{hn}\} \quad \bar{hi} \in \mathbf{R}^F$ Output : a new set of node feature

2022년 12월 8일
·
0개의 댓글
·
post-thumbnail

[Pytorch Geometric Tutorial] 1. Introduction to Pytorch geometric

Pytorch Geometric tutorial: Introduction to Pytorch geometric Problems of dealing graph in deep learning Different sizes 노드 크기에 따라 adjacency matrix의 크기가 달라짐 NOT invariant to node ordering 그래프가 위상적으로 동일하더라도 adjacency matrix는 다를 수 있음 Notation $$ \mathbf{G} = (V,E) $$ Computation Graph : The neighbour of a node define its computation graph ![](ht

2022년 12월 8일
·
0개의 댓글
·