fix adaptors - #199
Merged
Merged
Conversation
Copilot stopped work on behalf of
clemsgrs due to an error
June 9, 2026 13:38
Collaborator
Author
|
@copilot review the changes in this PR |
I've reviewed the changes in the last 4 commits. No significant issues, bugs, logic errors, or security vulnerabilities were found in the updated code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes four issues in vision adaptors:
KNNRegressor.fitincorrectly unpacked the return value ofpreprocess_features, which returns a single array.LinearProbingRegressorandMultiLayerPerceptronRegressorpassed[B]labels toMSELossagainst[B, 1]model outputs, causing unintended broadcasting.LinearProbingRegressorandMultiLayerPerceptronRegressorcomputed cumulative survival alongdim=0. During training, logits are[num_shots, nbins], so this ran the cumulative productacross shots instead of survival bins. This now uses
dim=-1.image-sizeis[width, height], while NumPy masks are[height, width]; inference now allocates(height, width),writes patches with
[y, x]indexing, and no longer transposes the final mask.Impact
the
KNNRegressorbug can cause fitting to fail for 3+ shots, or behave incorrectly with exactly 2 shots.the non-survival MSE broadcasting issue is serious for non-survival regression because it changes the objective from per-sample regression to effectively pushing all predictions toward the batch mean label. However, the practical impact should be limited as our sole regression task is a survival prediction task, so we have not used these non-survival regression heads.
the survival axis issue affects the training objective for survival regression heads. Prediction did not generally crash because case-level test embeddings are passed one case at a time as a 1D vector, where
dim=0happened to be the bin axis. Training, however, uses all shots as[num_shots, nbins], so the survival/censoring part of the loss was batch-order dependent.the 2D segmentation issue affects
segmentation-upsamplingfor Task 9. On square-ish data this can be partially masked by the final transpose, but local patch content is transposed and non-square images or edge patches can be cropped/placed incorrectly.