Fix output dimension in simple_mlp_predict - #24
Merged
Conversation
The model predicts mod2, so out_dim must be input_train_mod2.n_vars, not input_test_mod1.n_vars. Same mixup in the GEX2ATAC branch, where ymean (length n_vars(mod2)) is broadcast against n_vars(mod1).
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.
Describe your changes
simple_mlp_predictsizes the MLP output layer withinput_test_mod1.n_vars-- the source modality's width. But training sizes it withy.shape[1], i.e.train_mod2.n_vars:So
MLP.load_from_checkpoint(..., out_dim=input_test_mod1.n_vars, ...)raises a state-dict size mismatch onfc3whenevern_vars(mod1) != n_vars(mod2)-- which is every real dataset (GEX 13953 vs ADT 134). TheGEX2ATACbranch has the same mixup:ymeanhas lengthn_vars(mod2)but is broadcast againstnp.ones([n_obs, input_test_mod1.n_vars]).input_train_mod2is already read in on line 49, so it's a two-line change.The reason this never showed up in CI is worth a note: in
resources_testthe two modalities happen to have identical widths -- 134x134 forbmmc_cite, 1500x1500 forbmmc_multiome-- soviash testcan't distinguishn_vars(mod1)fromn_vars(mod2)and passes. I'll follow up with a fixture that has unequal widths so this class of bug can't hide again.Part of a series of PRs coming out of a pre-run review of the benchmark.
Checklist before requesting a review
I have performed a self-review of my code
Check the correct box. Does this PR contain:
Proposed changes are described in the CHANGELOG.md
CI Tests succeed and look good!