NegativeSamplerο
- class dgl.graphbolt.NegativeSampler(datapipe, negative_ratio)[source]ο
Bases:
MiniBatchTransformer
A negative sampler used to generate negative samples and return a mix of positive and negative samples.
Functional name:
sample_negative
.- Parameters:
datapipe (DataPipe) β The datapipe.
negative_ratio (int) β The proportion of negative samples to positive samples.