incerto.data.create_ood_dataloader

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 dataset

  • ood_dataset (Dataset) – Out-of-distribution dataset

  • batch_size (int) – Batch size

  • num_workers (int) – Number of workers

  • pin_memory (bool) – Whether to pin memory

  • mixed (bool) – If True, create single mixed loader; if False, separate loaders

  • mix_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