We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 399bbb4 + 5bcf181 commit 350e59fCopy full SHA for 350e59f
1 file changed
GNNGraphs/src/sampling.jl
@@ -58,7 +58,7 @@ function sample_nbrs(loader::NeighborLoader, node::Int, layer::Int)
58
return Int[]
59
else
60
num_samples = min(loader.num_neighbors[layer], length(neighbors)) # Limit to required samples for this layer
61
- return rand(neighbors, num_samples) # Randomly sample neighbors
+ return StatsBase.sample(neighbors, num_samples; replace = false) # Randomly sample distinct neighbors
62
end
63
64
0 commit comments