Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vid-koci
Copy link
Contributor

@vid-koci vid-koci commented Mar 19, 2025

Implement a basic GraphSAGE sampler inside the HeteroNeighborSampler.

@vid-koci vid-koci self-assigned this Mar 19, 2025
@vid-koci vid-koci marked this pull request as ready for review March 21, 2025 16:09
@vid-koci vid-koci requested a review from rusty1s March 21, 2025 16:09
Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

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

Great start.

Comment on lines +181 to +182
if (edge_time_.has_value())
TORCH_CHECK(seed_time.has_value(), "Seed time needs to be specified");
Copy link
Member

Choose a reason for hiding this comment

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

and node_time_? Perhaps we can add a utility function such as is_temporal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original implementation logic which I was following will just use node times from the graph if seed_time isn't given. I don't see a reason to deviate from the behaviour of hetero_neighbor_sample

Comment on lines +197 to +201
phmap::flat_hash_map<node_type, size_t> num_nodes_dict;
for (const auto& k : edge_types_) {
const auto num_nodes = rowptr_.at(to_rel_type(k)).size(0) - 1;
num_nodes_dict[std::get<0>(k)] = num_nodes;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we do it in init?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See my answer to the next comment

@rusty1s rusty1s merged commit 6084efe into master Mar 27, 2025
11 checks passed
@rusty1s rusty1s deleted the vid_hetero_neigh_sampler branch March 27, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants