Skip to content

Commit adf3dfd

Browse files
committed
reverted changes in recency sampler
1 parent 969b1a4 commit adf3dfd

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

tgm/hooks/neighbors/recency.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ class RecencyNeighborHook(StatefulHook, SeedableHook):
2727
id (str): A unique identifier for the hook. The hook’s name and all attributes it produces will be suffixed with this `id`.
2828
2929
Note:
30-
RecencyNeighborSamplerHook assumes queries occur in chronological order. Query timestamp is significantly behind the buffer's current timestamp. Results may be incomplete or incorrect.
3130
The order of the output tensors respect the order of seed_nodes_keys.
3231
For instance, for seed node keys ['edge_src', 'edge_dst', 'neg'] will have the first output index (hop 0) contain the concatenation
3332
of batch.edge_src, batch.edge_dst, batch.neg (in that order). The next index (hop 1) will contain first-hop neighbors of batch.edge_src
3433
followed by first-hop neighbors of batch.edge_dst, and then those of batch.neg. This pattern repeats for deeper hops.
3534
36-
3735
Raises:
3836
ValueError: If the num_nbrs list is empty or has non-positive entries.
3937
ValueError: If len(seed_nodes_keys) != len(seed_times_keys).
@@ -64,12 +62,6 @@ def __init__(
6462
if not all([isinstance(x, int) and (x > 0) for x in num_nbrs]):
6563
raise ValueError('Each value in num_nbrs must be a positive integer')
6664

67-
logger.warning(
68-
"RecencyNeighborSamplerHook: query timestamp is significantly behind the buffer's "
69-
'current timestamp. Results may be incomplete or incorrect. '
70-
'This hook assumes queries occur in chronological order.'
71-
)
72-
7365
self._num_nodes = num_nodes
7466
self._num_nbrs = num_nbrs
7567
self._max_nbrs = max(num_nbrs)
@@ -241,13 +233,6 @@ def _get_seed_tensors(
241233
def _get_recency_neighbors(
242234
self, node_ids: torch.Tensor, query_times: torch.Tensor, k: int
243235
) -> Tuple[torch.Tensor, ...]:
244-
if query_times.min() < self._nbr_times.min():
245-
logger.warning(
246-
"RecencyNeighborSamplerHook: query timestamp is significantly behind the buffer's "
247-
'current timestamp. Results may be incomplete or incorrect. '
248-
'This hook assumes queries occur in chronological order.'
249-
)
250-
251236
assert self._nbr_feats is not None # For mypy
252237
B = self._max_nbrs # buffer size
253238

0 commit comments

Comments
 (0)