recbole.data.dataloader.abstract_dataloader¶
- class recbole.data.dataloader.abstract_dataloader.AbstractDataLoader(config, dataset, sampler, shuffle=False)[source]¶
Bases:
object
AbstractDataLoader
is an abstract object which would return a batch of data which is loaded byInteraction
when it is iterated. And it is also the ancestor of all other dataloader.- Parameters
- shuffle¶
If
True
, dataloader will shuffle before every epoch.- Type
bool
- pr¶
Pointer of dataloader.
- Type
int
- batch_size¶
The max interaction number for all batch.
- Type
int
- property pr_end¶
This property marks the end of dataloader.pr which is used in
__next__()
.
- class recbole.data.dataloader.abstract_dataloader.NegSampleDataLoader(config, dataset, sampler, shuffle=True)[source]¶
Bases:
recbole.data.dataloader.abstract_dataloader.AbstractDataLoader
NegSampleDataLoader
is an abstract class which can sample negative examples by ratio. It has two neg-sampling method, the one is 1-by-1 neg-sampling (pair wise), and the other is 1-by-multi neg-sampling (point wise).