Skip to content

Heterodata to Seq#518

Closed
yliu2-sc wants to merge 7 commits intoyliu2/positional_encoding_transformfrom
yliu2/heterodata_to_seq
Closed

Heterodata to Seq#518
yliu2-sc wants to merge 7 commits intoyliu2/positional_encoding_transformfrom
yliu2/heterodata_to_seq

Conversation

@yliu2-sc
Copy link
Collaborator

Scope of work done

Where is the documentation for this feature?: N/A

Did you add automated tests or write a test plan?

Updated Changelog.md? NO

Ready for code review?: NO

@yliu2-sc yliu2-sc changed the base branch from main to yliu2/positional_encoding_transform February 27, 2026 00:39

def __init__(
self,
batch_size: int,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this transform require all batches to share the same batch size? For test batches, since we want to include all test samples, the last batch can contain less samples, will it still work?

reachable.indices(),
torch.ones(reachable._nnz(), device=device, dtype=torch.float),
size=(batch_size, num_nodes),
).coalesce()
Copy link
Collaborator

@zfan3-sc zfan3-sc Mar 17, 2026

Choose a reason for hiding this comment

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

It seems it does no harm if we skip the coalesce here? For positional encoding, if the user only plans to use hop distances w.r.t anchors, they can grab that information here, and do not need to run the hop distance transform that produces n x n sparse matrices on the whole graph.

max_seq_len: Maximum sequence length (neighbors beyond this are truncated).
anchor_node_type: The node type of anchor nodes.
feature_dim: Output feature dimension. If None, inferred from data.
If provided and different from input, features are projected.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see the projection logic?

@yliu2-sc
Copy link
Collaborator Author

Move to combine changes with #537

@yliu2-sc yliu2-sc closed this Mar 17, 2026
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

Successfully merging this pull request may close these issues.

2 participants