Skip to content

Commit

Permalink
add temporal_sample_layer_neighbor as an option to example.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Jul 5, 2024
1 parent 6366e9e commit f0c05f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/graphbolt/temporal_link_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def create_dataloader(args, graph, features, itemset, is_train=True):
# considering of temporal information. Only neighbors that is earlier than
# the seed will be sampled.
############################################################################
datapipe = datapipe.temporal_sample_neighbor(
datapipe = getattr(datapipe, args.sample_mode)(
graph,
args.fanout if is_train else [-1],
node_timestamp_attr_name=TIMESTAMP_FEATURE_NAME,
Expand Down Expand Up @@ -255,6 +255,12 @@ def parse_args():
help="Dataset storage placement and Train device: 'cpu' for CPU and RAM,"
" 'pinned' for pinned memory in RAM, 'cuda' for GPU and GPU memory.",
)
parser.add_argument(
"--sample-mode",
default="temporal_sample_neighbor",
choices=["temporal_sample_neighbor", "temporal_sample_layer_neighbor"],
help="The sampling function when doing layerwise sampling.",
)
return parser.parse_args()


Expand Down

0 comments on commit f0c05f4

Please sign in to comment.