incerto.data.create_ood_dataloader#
- incerto.data.create_ood_dataloader(id_dataset, ood_dataset, batch_size=128, num_workers=4, pin_memory=True, mixed=False, mix_ratio=0.5)[source]#
Create data loaders for OOD detection evaluation.
- Parameters:
id_dataset (
Dataset) – In-distribution datasetood_dataset (
Dataset) – Out-of-distribution datasetbatch_size (
int) – Batch sizenum_workers (
int) – Number of workerspin_memory (
bool) – Whether to pin memorymixed (
bool) – If True, create single mixed loader; if False, separate loadersmix_ratio (
float) – Ratio of ID samples in mixed loader (only if mixed=True)
- Returns:
Tuple of (id_loader, ood_loader) If mixed=True: Single mixed loader
- Return type:
If mixed=False