Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GNNGraphs/src/sampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function sample_nbrs(loader::NeighborLoader, node::Int, layer::Int)
return Int[]
else
num_samples = min(loader.num_neighbors[layer], length(neighbors)) # Limit to required samples for this layer
return rand(neighbors, num_samples) # Randomly sample neighbors
return StatsBase.sample(neighbors, num_samples; replace = false) # Randomly sample distinct neighbors
end
end

Expand Down
Loading