-
Notifications
You must be signed in to change notification settings - Fork 159
Temporal sample disable undirected #247
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
Temporal sample disable undirected #247
Conversation
Codecov Report
@@ Coverage Diff @@
## master #247 +/- ##
=======================================
Coverage 72.32% 72.32%
=======================================
Files 28 28
Lines 1120 1120
=======================================
Hits 810 810
Misses 310 310 📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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.
Hi @RexYing, I think the implementation is correct and looks good. Thank you!
If you spot any index_select errors during forward propagation, it is best to check that
for edge_type in data.edge_types:
src, _, dst = edge_type
assert data[edge_type].edge_index[0].max() < data[src].num_nodes
assert data[edge_type].edge_index[1].max() < data[dst].num_nodesholds. Can you confirm?
zechengz
left a comment
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.
The rows.push_back(src_samples.size() - 1); will resolve the out of index error.
|
@zechengz Good catch, you are right :) |
Co-authored-by: Zecheng Zhang <zecheng@kumo.ai>
Co-authored-by: Zecheng Zhang <zecheng@kumo.ai>
Co-authored-by: Zecheng Zhang <zecheng@kumo.ai>
…ng/pytorch_sparse into temporal_sample_disable_undirected
For temporal sampling, the undirected neighbor sampling does not make sense, since it may violate the time constraint when constructing subgraph from the sampled nodes.
Hence we disable directed=False case for temporal sampling. For direct=True case, we also skip the check if the node already existed, so that the same node (potentially with different time constraints due to different input nodes in the minibatch) can have multiple copies in the minibatch.