Fix novel silently saving no model on multiome/swap - #62
Merged
Conversation
An empty ATAC cell gives a constant lsi row, so the per-cell z-score divided 0 by 0. The resulting nan rmse never beat best_score, so tensor.pt was never written and novel_predict failed on a train step that had exited 0.
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.
novelscored 12/16 in therun_2026-08-01_11-48-20benchmark. The four missing scores are both multiome/swap datasets (2021 + 2022), wherenovel_predictdied on:What actually happened
novel_trainexited 0 and published a model directory with no model in it.The chain, straight from the run logs:
An empty ATAC cell produces a constant lsi row, so the per-cell z-score in
lsiTransformer.transform()divides 0 by 0 --helper_functions.py:78: RuntimeWarning: invalid value encountered in divide.That nan reaches
rmse(), andif best_score > rmse(...)is always False for nan, sotorch.save()never runs.train_and_valid()then prints its untouched sentinel and returns normally:So the train step looked green, and the failure only surfaced one step later in predict.
Changes
lsiTransformer.transform().None/nan-aware rather than a100000sentinel, and raise if it never became finite -- a training step that saves no model should fail, not exit 0.Verification
viash test src/methods/novel/novel_train/config.vsh.yaml: 1/1 passedviash test src/methods/novel/novel_predict/config.vsh.yaml: 1/1 passedThe fixture is bmmc_cite (ADT), so it does not exercise the lsi path that failed. Checked that separately against the real
lsiTransformerwith an all-zero cell present:The
helper_functions.py:33"divide by zero" warning also present in the run is left alone: empty rows have no stored values, so theinfnever multiplies anything and no nan reaches the output (0 NaN above, with that warning still firing).