Graph Sage - sample size question

Hi,

The GraphSAGE implementation refers to two parameters - search depth and sample size.

I understand that the search depth defines the maximum length of a random walk when sampling and aggregating node features for a given node.

I am struggling with how this intersects with the sample size, which I believe to be the number of nodes at each hop that can be sampled. For example if search depth = 2, and sample size = [10,15], then for k=1 up to 10 nodes will be sampled, and k=2 it will be 15.

What happens if I have search depth = 2 but sample size = [3,3,3,3] ?

Many thanks,
David

Hi @dmellor,

From my read of the documentation, the searchDepth parameter refers only to the sampling of positive examples used in the loss function computation. So for instance: given a node v, which are the other nodes in the graph we want to enforce to have similar embeddings? The searchDepth limits how far away from v we (randomly) walk to sample such nodes. The nodes we sample this way do not impact which nodes are in the subgraph around v which defines the computation graph used to compute v.

The sampleSizes on the other hand refers to how we sample the subgraph used to construct a computation graph for computing a node's embedding in a single iteration. This impacts what a node's embedding will be, but does not impact what positive examples show up in the loss function for this node.

So the searchDepth and sampleSizes are independent of each other you could say.

Hope this is helpful,
Adam