Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Example] add ogc method #6437

Merged
merged 13 commits into from
Nov 14, 2023
Merged

[Example] add ogc method #6437

merged 13 commits into from
Nov 14, 2023

Conversation

SinuoXu
Copy link
Contributor

@SinuoXu SinuoXu commented Oct 13, 2023

Description

An implementation of OGC method from the paper From Cluster Assumption to Graph Convolution: Graph-based Semi-Supervised Learning Revisited.

OGC is a simple but very powerful graph convolution method, with only one trainable layer. Our initial proposal of the model mainly contains two files: utils.py which defines some basic functions, and main.py which shows the training progress.

Table 1: Node classification accuracy (%).

Acc CiteSeer Cora PubMed
GCN (DGL) 71.0 81.0 79.0
GRAND (DGL) 74.0 83.7 78.8
GATv2 (DGL) 70.3 81.0 77.1
OGC (DGL) 77.4 86.9 83.6
OGC (Reported) 77.5 86.9 83.4

Table 2: Running time (s).

Time CiteSeer Cora PubMed
GCN (DGL) 7.8 4.7 9.7
GRAND (DGL) 248.7 99.6 237.8
GATv2 (DGL) 17.51 11.71 44.44
OGC (DGL) 2.18 0.95 1.87

We use three DGL's built_in datasets (Citeseer, Cora and Pubmed) with their default train/val/test settings. As shown above, OGC has a substantial improvement, with 100-200X high efficiency compared to SOTA deep GNNs.

We are very happy to further improve the code for this great project, and will continue to contribute actively!

Author: Sinuo Xu (undergraduate, @sjtu) advised by Dr. Zheng Wang@SJTU.

Checklist

Please feel free to remove inapplicable items for your PR.

  • [√] The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • [√] I've leverage the tools to beautify the python and c++ code.
  • [√] The PR is complete and small, read the Google eng practice (CL equals to PR) to understand more about small PR. In DGL, we consider PRs with less than 200 lines of core code change are small (example, test and documentation could be exempted).
  • [√] All changes have test coverage
  • [√] Code is well-documented
  • If the PR is for a new model/paper, I've updated the example index here.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Commit ID: f30d57d

Build ID: 1

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Commit ID: 2209d7f

Build ID: 2

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Commit ID: 25ca95b

Build ID: 3

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Commit ID: deb1cc3

Build ID: 4

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 13, 2023

Commit ID: c6768ce

Build ID: 5

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

ogc.py Outdated Show resolved Hide resolved
@frozenbugs frozenbugs requested review from frozenbugs and removed request for jermainewang October 19, 2023 02:30
@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 19, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 19, 2023

Commit ID: 233bfccb55e369b0f0290c21cc89174fa762e1d8

Build ID: 6

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

examples/pytorch/ogc/README.md Show resolved Hide resolved
Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 24, 2023

Commit ID: c2646d75416f0187835955afaaa4b4e92aee2996

Build ID: 8

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 25, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 25, 2023

Commit ID: 9e90823f0b2c95e09dcc20a0699eb328d1ab17a1

Build ID: 9

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 25, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 25, 2023

Commit ID: 387268016f9eabca1755fd7eb8c9563232d3ebfe

Build ID: 10

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 25, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 25, 2023

Commit ID: d08fa98e59c65613383f174bf2feaa070e7637e0

Build ID: 11

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@frozenbugs
Copy link
Collaborator

@BarclayII can you double check the implementation?

@frozenbugs
Copy link
Collaborator

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 27, 2023

Commit ID: fe3b8646a1562ede2dabe06477d81c6fbcbe9aa0

Build ID: 12

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

Copy link
Collaborator

@BarclayII BarclayII left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The math looks simple and I don't have any problems. My concerns are namely in code styles which is uncommon to PyTorch practices. Normally in PyTorch we write training code like this:

class OGC(nn.Module):
    def __init__(self, ...):
        # model parameter definition...
    def forward(self, ...):
        # Given the input, how to compute the output (i.e. according to Eq 6 in your paper)
...
model = OGC(...)
def train(model, ...):
    optimizer = torch.optim.SGD(...)
    for _ in range(epochs):
        # compute loss...
        # call optimizer...

examples/pytorch/ogc/utils.py Outdated Show resolved Hide resolved
examples/pytorch/ogc/ogc.py Outdated Show resolved Hide resolved
examples/pytorch/ogc/ogc.py Outdated Show resolved Hide resolved
examples/pytorch/ogc/utils.py Outdated Show resolved Hide resolved
examples/pytorch/ogc/utils.py Outdated Show resolved Hide resolved
@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 13, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 13, 2023

Commit ID: 113b55321016ae7a35129698485226f0c9ecaca1

Build ID: 13

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 13, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 13, 2023

Commit ID: 95414438f47d16d01ff83bbfe1fad66c3336d28f

Build ID: 14

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 13, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 13, 2023

Commit ID: aaa68486529bb3c9ea6ae4f5e16bbbf8f36beddb

Build ID: 15

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@frozenbugs
Copy link
Collaborator

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 14, 2023

Commit ID: 5e07764ca2a134e2b214dd8f96f3bda920f54094

Build ID: 16

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@frozenbugs frozenbugs merged commit 07db09f into dmlc:master Nov 14, 2023
2 checks passed
peizhou001 pushed a commit to peizhou001/dgl that referenced this pull request Nov 27, 2023
Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
DominikaJedynak pushed a commit to DominikaJedynak/dgl that referenced this pull request Mar 12, 2024
Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants