Repository navigation
Keep censored survival log scores and gradients stable in the tail - #459
Open
rudycelekli wants to merge 2 commits into
Open
rudycelekli wants to merge 2 commits into
rudycelekli wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Censored Exponential and LogNormal log scores calculate log(1-cdf+epsilon), causing valid tail losses to plateau and become inconsistent with the gradients. At time/scale=1000, the Exponential loss is capped near 23.03 instead of 1000; a standardized LogNormal log-time of 40 is capped near 11.51 instead of 804.61.
Use the distributions' logsf and compute the LogNormal inverse Mills ratio through standard-normal logpdf-logsf. Five regression/control cases compare actual scores with SciPy log-survival values and gradients with independent erfcx/finite-difference oracles, including observed and mixed censoring inputs.
Validation on Python 3.11.15, scikit-learn 1.6.1, NumPy 2.4.6 and SciPy 1.17.1: this independent branch's regression tests and full configured pre-commit hooks pass. The unchanged upstream slow suite passes 169 tests, with 2 xfailed and 22 xpassed. A private composition of the six proposed fixes passes 201 tests with the same expected/unexpected-pass statuses; final organized regression tests pass all 32 cases and combined lint passes. The production files are identical across that integration run and the final branches; test organization was verified separately.
Implementation and tests are AI-assisted, with additional independent automated correctness/duplicate review. Numerical cases use synthetic fixtures and analytic/SciPy oracles. Hosted CI and maintainer acceptance are separate from these local results.