Skip to content

Temporal Sampling for NeighborLoader Within a Time Window #10593

@Zrealshadow

Description

@Zrealshadow

🚀 The feature, motivation and pitch

I noticed that PyG currently supports temporal neighbor sampling by setting temporal_strategy="latest" in NeighborLoader, which samples the most recent num_neighbors based on a given input_time.

I’m wondering whether it would be possible to support an additional parameter, for example time_window, to restrict neighbor sampling to a latest time window relative to input_time.

Conceptually, instead of selecting the latest k neighbors globally, the loader would first filter neighbors whose timestamps satisfy:

input_time - time_windowedge_timeinput_time

and then sample neighbors (optionally capped by num_neighbors) from this subset.

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions