recbole.data.dataloader.general_dataloader¶
- class recbole.data.dataloader.general_dataloader.FullSortEvalDataLoader(config, dataset, sampler, shuffle=False)[source]¶
Bases:
recbole.data.dataloader.abstract_dataloader.AbstractDataLoader
FullSortEvalDataLoader
is a dataloader for full-sort evaluation. In order to speed up calculation, this dataloader would only return then user part of interactions, positive items and used items. It would not return negative items.- Parameters
- batch_size: Optional[int]¶
- collate_fn(index)[source]¶
Collect the sampled index, and apply neg_sampling or other methods to get the final data.
- dataset: torch.utils.data.dataset.Dataset[torch.utils.data.dataloader.T_co]¶
- drop_last: bool¶
- num_workers: int¶
- pin_memory: bool¶
- pin_memory_device: str¶
- prefetch_factor: int¶
- sampler: Union[torch.utils.data.sampler.Sampler, Iterable]¶
- timeout: float¶
- update_config(config)[source]¶
Update configure of dataloader, such as
batch_size
,step
etc.- Parameters
config (Config) – The new config of dataloader.
- class recbole.data.dataloader.general_dataloader.NegSampleEvalDataLoader(config, dataset, sampler, shuffle=False)[source]¶
Bases:
recbole.data.dataloader.abstract_dataloader.NegSampleDataLoader
NegSampleEvalDataLoader
is a dataloader for neg-sampling evaluation. It is similar toTrainDataLoader
which can generate negative items, and this dataloader also permits that all the interactions corresponding to each user are in the same batch and positive interactions are before negative interactions.- Parameters
- batch_size: Optional[int]¶
- collate_fn(index)[source]¶
Collect the sampled index, and apply neg_sampling or other methods to get the final data.
- dataset: torch.utils.data.dataset.Dataset[torch.utils.data.dataloader.T_co]¶
- drop_last: bool¶
- num_workers: int¶
- pin_memory: bool¶
- pin_memory_device: str¶
- prefetch_factor: int¶
- sampler: Union[torch.utils.data.sampler.Sampler, Iterable]¶
- timeout: float¶
- update_config(config)[source]¶
Update configure of dataloader, such as
batch_size
,step
etc.- Parameters
config (Config) – The new config of dataloader.
- class recbole.data.dataloader.general_dataloader.TrainDataLoader(config, dataset, sampler, shuffle=False)[source]¶
Bases:
recbole.data.dataloader.abstract_dataloader.NegSampleDataLoader
TrainDataLoader
is a dataloader for training. It can generate negative interaction whentraining_neg_sample_num
is not zero. For the result of every batch, we permit that every positive interaction and its negative interaction must be in the same batch.- Parameters
- batch_size: Optional[int]¶
- collate_fn(index)[source]¶
Collect the sampled index, and apply neg_sampling or other methods to get the final data.
- dataset: torch.utils.data.dataset.Dataset[torch.utils.data.dataloader.T_co]¶
- drop_last: bool¶
- num_workers: int¶
- pin_memory: bool¶
- pin_memory_device: str¶
- prefetch_factor: int¶
- sampler: Union[torch.utils.data.sampler.Sampler, Iterable]¶
- timeout: float¶
- update_config(config)[source]¶
Update configure of dataloader, such as
batch_size
,step
etc.- Parameters
config (Config) – The new config of dataloader.