peal.training.trainers.distill_dataloader_mixer

peal.training.trainers.distill_dataloader_mixer(predictor_distillation, base_path, predictor, predictor_datasource)[source]

Recursively relabel every loader inside a DataloaderMixer.

Nested mixers are handled recursively under <base_path>/<i>; plain loaders go through distill_binary_dataset() and are re-wrapped in a DataLoader with the original batch size. The copied mixer is reset before being returned.

Parameters:
  • predictor_distillation (str, dict or PredictorConfig) – Config of the student.

  • base_path (str) – Root directory for the prediction files.

  • predictor (torch.nn.Module) – Teacher that produces the labels.

  • predictor_datasource (DataloaderMixer) – Mixer to relabel (deep-copied, not modified).

Returns:

A mixer over the relabelled loaders.

Return type:

DataloaderMixer