mixle.doe.distillation moduleΒΆ

Pool-based DOE for task distillation and cross-modal training.

Distillation turns teacher calls, human labels, or paired cross-modal records into an expensive experiment budget. This module chooses which candidate examples to spend that budget on. It is model-agnostic: callers provide embeddings/features, optional uncertainty or preference scores, task tags, modality tags, and label costs; DOE returns indices that balance informativeness, diversity, multi-task coverage, cross-modal coverage, and cost.

class DistillationDesign(indices, scores, task_counts=<factory>, modality_counts=<factory>, candidate_scores=<factory>, metadata=<factory>)[source]

Bases: object

Selected pool indices and diagnostics for a distillation design.

indices point into the exact candidate pool supplied to the selector. scores are the sequential merits assigned to the chosen candidates. candidate_scores preserves the base uncertainty/preference score before diversity, coverage, and cost terms are applied. metadata records the target coverage and weights needed to audit or reproduce the design.

Parameters:
distillation_design(features, n, *, task_labels=None, modalities=None, uncertainty=None, preference=None, cost=None, task_weights=None, modality_weights=None, reference_features=None, eligible=None, uncertainty_weight=1.0, diversity_weight=1.0, task_coverage_weight=1.0, modality_coverage_weight=1.0, preference_weight=1.0, cost_weight=1.0, seed=None)[source]

Select a pool subset for teacher labeling or student distillation.

features is an (N, d) embedding/feature matrix for candidate examples. task_labels and modalities may be one tag per row or a sequence of tags per row. uncertainty may be (N,) or (N, T); the latter is averaged across the task tags present on each candidate. Higher uncertainty/preference and better coverage increase merit; higher cost lowers it.

Parameters:
Return type:

DistillationDesign

multitask_distillation_design(*args, **kwargs)[source]

Alias for distillation_design() that reads naturally at multi-task call sites.

Parameters:
Return type:

DistillationDesign

cross_modal_distillation_design(modality_features, n, *, task_labels=None, uncertainty=None, preference=None, cost=None, required_modalities=None, min_modalities=2, alignment_weight=1.0, seed=None, **kwargs)[source]

Select paired cross-modal records for distillation/alignment training.

modality_features maps modality name to an (N, d_m) feature matrix. Rows with non-finite values are treated as missing for that modality. The selector fuses standardized modality features, tags each row by available modalities, and adds an alignment-disagreement preference for modality pairs that share the same embedding width. By default only rows with at least two modalities are eligible.

Parameters:
Return type:

DistillationDesign