Skip to content

Build the failure views from the fused checkpoint's predictions - #81

Open
duckyquang wants to merge 3 commits into
feat/eval-artifactsfrom
feat/fused-failure-views
Open

Build the failure views from the fused checkpoint's predictions#81
duckyquang wants to merge 3 commits into
feat/eval-artifactsfrom
feat/fused-failure-views

Conversation

@duckyquang

Copy link
Copy Markdown
Member

Summary

The taxonomy, complementarity matrix and loud-vs-silent dropout profile — the three views that are the point of src/primed_ai/failure/ — were only ever produced by the harness's own Ridge. So the project's headline contribution was demonstrated on a model none of the reported tables use, and the two disagree badly enough that it matters: the ridge harness puts drop-echo MAE at 117.5 where the fused checkpoint gives 20.55 on the same 245 rows.

This adds a --predictions route that reads the per-example dump evaluate_missing_modality.py already writes, so the views describe the checkpoint the paper reports. Nothing is refit. With two modalities the harness only ever asks for the full set and each singleton, and the eval has already scored exactly those three conditions, so it's a re-reading of the reported predictions rather than a second model:

  • full{echo, ecg}
  • echo_dropped{ecg}
  • ecg_dropped{echo}

analyze_modality_failure takes modality names directly now. It never read the embedding values, only the keys, and a caller holding predictions has no arrays to pass — list(embeddings) already did the right thing for both, so it's a rename and a docstring.

Two ways this route could quietly lie, both guarded and tested: the sanitized docs/results/ copy has its per-example blocks stripped (it raises instead of half-running), and conditions whose label vectors drift out of order would silently compare different patients. The fused report also gets its own default output dir, so it can't land on top of the ridge one.

Refs #79. I'd leave that issue open until the artifacts are regenerated — see Notes.

Notes

The taxonomy, complementarity matrix and dropout profile were only ever produced
by the harness's Ridge, so the project's headline contribution was demonstrated
on a model no reported table uses. The two disagree badly enough that it matters:
drop-echo MAE 117.5 against the checkpoint's 20.55.

With two modalities the harness only asks for the full set and each singleton,
and the missing-modality eval has already scored exactly those three conditions
and writes them per example. So --predictions re-reads that dump instead of
fitting anything, and the views describe the checkpoint the paper reports.

The harness takes modality names directly now -- it never read the embedding
values, only the keys, and a caller holding predictions has no arrays to pass.
Guarded the two ways this route can silently lie: the sanitized bundle copy has
its per-example blocks stripped, and conditions whose labels drift out of order
would compare different patients.

@sebasmos sebasmos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read at bfd7df9 on top of b849306; 121 tests pass.

The route is right, and the case for it is stronger than the description makes it sound. The committed ridge report calls drop-echo 100 percent silent at MAE 117.5; the checkpoint calls the same condition loud at 20.55. They do not disagree on magnitude, they invert the paper's headline, so this is not a labelling tidy-up. Naming the artifact after its producer and giving the fused route its own default out dir is the correct fix, and reusing the already-scored conditions rather than refitting is what makes it a re-reading rather than a second model.

Two small things.

  1. The order guard compares lvef across conditions but not ef_le_40, so a dump whose gate vector drifted would still pass.

  2. Right to hold #79 open. Until failure_report.fused.json exists nothing here has touched the real fold, and #76 is waiting on that file, not on this merge.

Approving to merge after #74.

@kevzho kevzho left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fused failure-analysis route now correctly reuses the checkpoint’s per-example predictions without refitting a model, validates condition alignment, records provenance, and includes appropriate tests. The regenerated failure_report.fused.json is committed, and the updated SHA256SUMS includes the artifact. The implementation and reproducibility requirements are complete. Approving this PR for merge.

@sebasmos sebasmos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving at 322f6a4. 121 tests pass and all eight bundle lines verify with sha256sum -c.

failure_report.fused.json is the first time the three views describe the model the paper reports, and the result is the thesis rather than a restatement of it:

Dropped Induced critical Silent Silent rate Marginal value
echo 174 39 0.224 10.12
ECG 7 6 0.857 0.81

The modality worth almost nothing on average is the one whose loss hides. That is the separation between value and detectability the framework was built to measure, now measured on the reported checkpoint rather than on planted data.

The ridge report inverts both axes, 1.0 silent for drop-echo and 0.271 for drop-ECG, so it would have told the opposite story on both counts. #76 can only be built from this file.

One thing for the paper rather than for the code: 0.857 is 6 of 7 induced-critical cases. The denominator has to travel with that rate wherever it is printed, or it reads as a stable estimate and it is not.

Worth recording that the ridge report came through @kevzho's rerun byte-identical while every torch checkpoint moved, which is what localises that nondeterminism to probe training. Provenance here is internally consistent, 7cae4f92 with the same manifest, so this artifact and the regenerated bundle describe one run.

Merging this needs #74 first, and I have asked there for one docs commit before that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants