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

Question on weighted graph #33

Open
xianshu1 opened this issue Feb 4, 2021 · 5 comments
Open

Question on weighted graph #33

xianshu1 opened this issue Feb 4, 2021 · 5 comments

Comments

@xianshu1
Copy link

xianshu1 commented Feb 4, 2021

I have a weighted graph, where each edge has weight assign to it. Is it possible to incorporate edge weight into the learning as well?
If yes, could you advise how shall I do this? Thank you.

@acbull
Copy link
Owner

acbull commented Feb 4, 2021

Hi.

Our model indeed supports encode edge information. In our case, we treat discrete timestamp as the edge feature and adopt a temporal encoding (

class RelTemporalEncoding(nn.Module):
) to encode it, which will be added to the source node when passing to the target.

If your feature is continuous (like weight), you can simply adopt another encoding method to project them into a d-dimensional vector, and replace the sinusoid embedding table in the RTE, and then the weights (edge feature) could be encoded.

@xianshu1
Copy link
Author

xianshu1 commented Feb 4, 2021

Thank you for your quick reply. This helps a lot.
Do you have suggestions on what encoding function would work well for continuous feature (like weight) to project them into a d-dimensional vector?

@acbull
Copy link
Owner

acbull commented Feb 5, 2021

You can try this paper: http://proceedings.mlr.press/v119/liu20n/liu20n.pdf

@xianshu1
Copy link
Author

xianshu1 commented Feb 5, 2021

Thank you for the reference.

I am wondering if an alternative way to incorporate edge weight would be multiply edges weights to the heterogeneous mutual attention coefficients prior to apply softmax?

@acbull
Copy link
Owner

acbull commented Feb 5, 2021 via email

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

No branches or pull requests

2 participants