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

[Model] Implement Grace-POT #171

Merged
merged 10 commits into from
Jan 12, 2024
Merged

[Model] Implement Grace-POT #171

merged 10 commits into from
Jan 12, 2024

Conversation

guofeng97
Copy link
Contributor

@guofeng97 guofeng97 commented Oct 19, 2023

Description

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented
  • To the best of my knowledge, examples are either not affected by this change,
    or have been fixed to be compatible with this change
  • Related issue is referred in this PR

Changes

@guofeng97
Copy link
Contributor Author

10.19 gf grace-pot

from gammagl.datasets import Planetoid, Coauthor, Amazon
import gammagl.transforms as T

from grace_pot import Encoder, Model
Copy link
Contributor

Choose a reason for hiding this comment

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

There is an error here, this should be gammagl.models.grace-pot.

import tensorlayerx as tlx
from tensorlayerx.optimizers import Adam
import torch
from model_ggl import LogReg
Copy link
Contributor

Choose a reason for hiding this comment

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

There is also an error here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend the LogReg in grace_pot to be moved here.

import tensorlayerx as tlx
from tensorlayerx.optimizers import Adam
import torch
from model_ggl import LogReg
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend the LogReg in grace_pot to be moved here.

import tensorflow

def BCEWithLogitsLoss(output, target):
return torch.nn.BCEWithLogitsLoss()(output, target)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this function is of no use.

pot_score = mm(An_ptb, H_tilde) + b_tilde_2.reshape(-1,1)
pot_score = tlx.squeeze(pot_score,axis=1)
target = tlx.zeros(tlx.get_tensor_shape(pot_score)) + 1
pot_loss = BCEWithLogitsLoss(pot_score, target)
Copy link
Contributor

Choose a reason for hiding this comment

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

You may use tlx.losses.sigmoid_cross_entropy(pot_score, target).

def forward(self, x, edge_index):
return self.encoder(x, edge_index)

def projection(self, z: tlx.convert_to_tensor)->tlx.convert_to_tensor:
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean? The type of z is tlx.convert_to_tensor? Remember to correct the other similar error.

@dddg617 dddg617 changed the title Grace-POT [Model] Implement Grace-POT Oct 19, 2023
@guofeng97
Copy link
Contributor Author

10.19-19:34-version

@dddg617
Copy link
Contributor

dddg617 commented Nov 30, 2023

[Record here] We may use the gspmm in gammgl.mpops to implement the function of torch.sparse.mm.

@dddg617 dddg617 merged commit 10c6962 into BUPT-GAMMA:main Jan 12, 2024
dddg617 added a commit that referenced this pull request Jan 12, 2024
* Grace-POT

* Grace-POT

* [Model] Update Model

* nightly update

* [Model] Update Grace_POT

* nightly udpate

* nightly update

* nightly update

---------

Co-authored-by: dddg617 <996179900@qq.com>
Co-authored-by: dddg617 <75086617+dddg617@users.noreply.github.com>
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.

2 participants