rhscope.probes.logistic¶
L2-regularized logistic regression probe over pooled activations.
Trained with torch-native L-BFGS; converges quickly for the probe sizes we
care about (hidden dims up to ~8k, dataset sizes up to ~50k). The score
method returns raw logits; apply metrics.sigmoid to get calibrated-ish
probabilities for ECE and Brier.
- class rhscope.probes.logistic.LogisticProbe(metadata, *, l2=1.0, max_iter=200)[source]¶
Bases:
ProbeBinary logistic-regression probe with L2 regularization.
- Variables:
probe_type (ClassVar[str]) – Discriminator used by the
Proberegistry.l2 – Strength of the L2 penalty on weights (not bias). Recorded in metadata.extra for round-trip.
- Parameters:
metadata (ProbeMetadata)
l2 (float)
max_iter (int)
- fit(hack_activations, clean_activations)[source]¶
Fit the logistic probe with L-BFGS.
- Parameters:
- Raises:
ValueError – If inputs are empty, mis-shaped, or mis-dimensioned.
- Return type:
None