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:
objectSelected pool indices and diagnostics for a distillation design.
indicespoint into the exact candidate pool supplied to the selector.scoresare the sequential merits assigned to the chosen candidates.candidate_scorespreserves the base uncertainty/preference score before diversity, coverage, and cost terms are applied.metadatarecords the target coverage and weights needed to audit or reproduce the design.
- 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.
featuresis an(N, d)embedding/feature matrix for candidate examples.task_labelsandmodalitiesmay be one tag per row or a sequence of tags per row.uncertaintymay 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; highercostlowers it.- Parameters:
features (Any)
n (int)
task_labels (Sequence[Any] | Sequence[Sequence[Any]] | ndarray | None)
modalities (Sequence[Any] | Sequence[Sequence[Any]] | ndarray | None)
uncertainty (Any | None)
preference (Any | None)
cost (Any | None)
modality_weights (Mapping[Any, float] | Sequence[float] | None)
reference_features (Any | None)
eligible (Any | None)
uncertainty_weight (float)
diversity_weight (float)
task_coverage_weight (float)
modality_coverage_weight (float)
preference_weight (float)
cost_weight (float)
seed (int | RandomState | None)
- Return type:
DistillationDesign
- multitask_distillation_design(*args, **kwargs)[source]
Alias for
distillation_design()that reads naturally at multi-task call sites.
- 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_featuresmaps 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.