SubgraphSamplingOptions

Options & Configuration · AiDotNet.Models.Options

Configuration for subgraph neighborhood sampling during federated GNN training.

For Beginners

GNNs learn by aggregating features from neighboring nodes (message passing). In a large graph, using all neighbors at every hop is too expensive. Neighborhood sampling limits how many neighbors are used at each hop, trading off accuracy for speed.

How It Works

Example: With HopCount=2 and MaxNeighborsPerHop=10, for each node we sample up to 10 neighbors at hop 1, and for each of those, sample up to 10 neighbors at hop 2. This gives a 2-hop subgraph of up to ~110 nodes instead of potentially thousands.

Constructors

Constructor Summary
SubgraphSamplingOptions()

Properties

Property Summary
bool IncludeSelfLoops { get; set; } Gets or sets whether to include self-loops in the sampled subgraph.
bool UseImportanceSampling { get; set; } Gets or sets whether to use importance sampling (degree-proportional) instead of uniform.
int HopCount { get; set; } Gets or sets the number of hops for neighborhood sampling.
int MaxNeighborsPerHop { get; set; } Gets or sets the maximum number of neighbors to sample per hop.
int MinNodeDegree { get; set; } Gets or sets the minimum degree a node must have to be included in sampling.