peal.teachers

Teachers: the sources of feedback an adaptor learns from.

A teacher implements interfaces.TeacherInterface.get_feedback and labels the explanations an explainer produced (typically: did the counterfactual change the true feature, a spurious one, or leave the data manifold?). Included are a human in a Flask GUI (human2model_teacher), a headless Claude process (llm2model_teacher), another model with optional label noise (model2model_teacher), segmentation masks, symbolic rules, the SpRAy / ViRelAy clustering tools, direction-level labelling for DiDAE (cluster_teacher, preclustered_teacher), the web-demo feedback bridge and a no-feedback baseline. teacher_factory.get_teacher resolves the teacher config string to one of them.

Submodules

baseline_teacher

A teacher that answers with a fixed or random verdict.

cluster_teacher

Human-in-the-loop teacher that collects one verdict per counterfactual cluster.

human2model_teacher

Interactive Flask teacher that asks a human to label counterfactual collages.

interfaces

Minimal interface every PEAL teacher implements.

llm2model_teacher

LLM-in-the-loop teacher.

model2model_teacher

Oracle teacher that judges counterfactuals with a second classifier.

preclustered_teacher

Teacher that grades counterfactuals by a precomputed cluster assignment.

segmentation_mask_teacher

A teacher that judges counterfactuals with ground-truth segmentation masks.

spray_teacher

SpRAy teacher: find confounded samples by clustering LRP attributions.

symbolic_teacher

Teacher for tabular data with a known symbolic confounder feature.

teacher_factory

Factory that turns a teacher config value into a TeacherInterface.

virelay_teacher

CFKD teacher that gathers human feedback through the ViReLay web GUI.

web_feedback_teacher

File-based feedback teacher for the web demo.