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

added DyRep #27

Merged
merged 10 commits into from
May 12, 2023
Merged

added DyRep #27

merged 10 commits into from
May 12, 2023

Conversation

fpour
Copy link
Collaborator

@fpour fpour commented Apr 30, 2023

DyRep implementation is done. The following files are modified for implementing the DyRep model.

  • examples/edgeprediction/dyrep_LP.py
  • models/tgn_dyrep.py

neighbor_loader = LastNeighborLoader(data.num_nodes, size=10, device=device)



Copy link
Owner

Choose a reason for hiding this comment

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

should we move GraphAttentionEmbedding to models folder as well? Since it will be used in multiple example datasets

@@ -99,7 +90,7 @@ def __init__(self, in_channels):
def forward(self, z_src, z_dst):
h = self.lin_src(z_src) + self.lin_dst(z_dst)
h = h.relu()
return self.lin_final(h)
return self.lin_final(h).sigmoid()
Copy link
Owner

Choose a reason for hiding this comment

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

better approach might be to specify the non-linearity in the arguments for the layer
ie. act="sigmoid" and if act=="sigmoid", return self.lin_final(h).sigmoid()

@@ -0,0 +1,373 @@
"""
Copy link
Owner

Choose a reason for hiding this comment

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

after deciding, we should have one example per method for a given dataset. i.e. going with any vs. all or one vs. all

@@ -0,0 +1,115 @@
"""
Copy link
Owner

Choose a reason for hiding this comment

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

should have

  • function for generating all negatives (no negative sampling needed, use all)
  • function for loading the existing sampled negatives from disc (to do)

@shenyangHuang
Copy link
Owner

shenyangHuang commented May 3, 2023

Comments

  • rename tgn_dyrep.py into dyrep_model.py
  • rename the class in tgn_dyrep.py
  • move repeated models to models folder, for example GraphAttentionEmbedding to models folder
  • add activation argument to link predictor arguments , def __init__(self, in_channels, act="none"):
  • [ ]

@fpour
Copy link
Collaborator Author

fpour commented May 8, 2023

The negative sampling with two different variations (RND & HIST-RND) is added (generate batches on the fly).
The evaluator has been cleaned to only compute MRR and Hits@k.
The code has been cleaned and more modularized with different modules defined in models folder.
examples/edgeprediction/tgn_one_vs_many.py is up-to-date.
JODIE and DyRep examples need to be updated (under construction).
TGAT model needs major reconstruction (mainly neighbor sampler).

@shenyangHuang shenyangHuang merged commit f65a0f3 into main May 12, 2023
shenyangHuang pushed a commit that referenced this pull request Jun 26, 2024
Adding myket negative sampling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants