Metrics¶
Diagnostics such as the pi-scale recruitment read-out and ensemble disagreement.
polyweave.metrics ¶
Diagnostics: the pi-scale gate and ensemble (dis)agreement.
These are the two measurement stories of the project:
pi_scale_mean— how strongly a Sigma-Pi block recruits its multiplicative branch. Growth of this scalar across training is the paper's central diagnostic.- the
ensemble_*helpers — for comparing a vanilla-teacher student ensemble against a Sigma-Pi-teacher student ensemble. Disagreement rate captures whether the two teachers induce qualitatively different students, beyond mean accuracy.
pi_scale_mean ¶
exp(pi_scale).mean() for a Sigma-Pi block or any module containing one.
Accepts a raw pi_scale Parameter/Tensor, an object with a .pi_scale
attribute, or an nn.Module somewhere inside which a pi_scale parameter
lives (the first one found is used).
Source code in polyweave/metrics.py
disagreement_rate ¶
Fraction of samples on which the ensemble members are not unanimous.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preds
|
Sequence[Tensor]
|
list of |
required |
Returns:
| Type | Description |
|---|---|
float
|
Scalar in |
Source code in polyweave/metrics.py
pairwise_disagreement ¶
Mean fraction of differing predictions averaged over all model pairs.
Source code in polyweave/metrics.py
majority_vote ¶
Hard-voting ensemble prediction. Ties are broken by lowest class index.
Source code in polyweave/metrics.py
ensemble_accuracy ¶
Majority-vote ensemble accuracy against targets ([N] class indices).
Source code in polyweave/metrics.py
mean_accuracy ¶
Mean per-member accuracy (the baseline the ensemble is compared against).