-
Notifications
You must be signed in to change notification settings - Fork 82
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
Conversation
10.19 gf grace-pot |
from gammagl.datasets import Planetoid, Coauthor, Amazon | ||
import gammagl.transforms as T | ||
|
||
from grace_pot import Encoder, Model |
There was a problem hiding this comment.
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
.
examples/grace-pot/eval_gracepot.py
Outdated
import tensorlayerx as tlx | ||
from tensorlayerx.optimizers import Adam | ||
import torch | ||
from model_ggl import LogReg |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
examples/grace-pot/eval_gracepot.py
Outdated
import tensorlayerx as tlx | ||
from tensorlayerx.optimizers import Adam | ||
import torch | ||
from model_ggl import LogReg |
There was a problem hiding this comment.
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.
gammagl/models/grace_pot.py
Outdated
import tensorflow | ||
|
||
def BCEWithLogitsLoss(output, target): | ||
return torch.nn.BCEWithLogitsLoss()(output, target) |
There was a problem hiding this comment.
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.
gammagl/models/grace_pot.py
Outdated
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) |
There was a problem hiding this comment.
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)
.
gammagl/models/grace_pot.py
Outdated
def forward(self, x, edge_index): | ||
return self.encoder(x, edge_index) | ||
|
||
def projection(self, z: tlx.convert_to_tensor)->tlx.convert_to_tensor: |
There was a problem hiding this comment.
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.
10.19-19:34-version |
[Record here] We may use the |
* 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>
Description
Checklist
Please feel free to remove inapplicable items for your PR.
or have been fixed to be compatible with this change
Changes