dmlc / dmlc/dgl

add edge norm to EGAT and GAT

Open
#5,459 7 comments 0 reactions 0 assignees View on GitHub
feature request topic: GNN Utilities topic: python api
Dominant language
Python
Stars
14.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## 🚀 Feature
Add edge norm to EGAT and GAT for edge masking.

## Motivation
EGAT and GAT calculate attention weight between nodes.
However, in some cases we need to mask some edges and need to block message passing.
There may be cases where we need to filter only certain kinds of edges for message passing,
or where we want to artificially increase or decrease the attribute weight based on edge type or node type.

For example, I used two EGAT layers. I created two layers, one utilizing local edge attachments and one utilizing global edge attachments. When utilizing local edge attachments, I masked the global edges, and when utilizing global edge attachments, I did the opposite.

## Alternatives
I applied the edge norm to the forward function to reflect the edge norm in the EGAT and GAT source code.

## Pitch
```
def forward(self, graph, feat, norm=None, get_attention=False)
```
Add a `norm` parameter to the forward function of each model.
The `norm` parameter is multiplied by the attention weight before message passing is performed.

## Additional context
I needed this feature for my thesis and implemented it myself. I hope to be able to contribute myself.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.