GraphSAINTEdgeSampler
¶
GraphSAINTEdgeSampler(
data: GraphData,
batch_size: int,
num_steps: int = 1,
sample_coverage: int = 0,
save_dir: Optional[str] = None,
)
Bases: GraphSAINTSampler
GraphSAINT edge sampler: samples batch_size edges without
replacement with probability proportional to
1 / out_degree(source) + 1 / in_degree(target), and takes the subgraph
induced by their endpoints.
Note
This follows the edge probabilities of the GraphSAINT paper (and of
its reference implementation), which minimize the variance of the
normalized aggregation. PyG's implementation instead uses
in_degree(source) + out_degree(target), which favors the edges
between high-degree nodes, and draws the batch_size edges with
replacement.
See GraphSAINTSampler for the arguments and the batch content.
Example:
from mlx_graphs.loaders import GraphSAINTEdgeSampler
loader = GraphSAINTEdgeSampler(data, batch_size=4000, num_steps=5)
Source code in mlx_graphs/loaders/graph_saint.py
from mlx_graphs.loaders import GraphSAINTEdgeSampler · mlx_graphs/loaders/graph_saint.py