autonlab / auton-survival

Auton Survival - an open source package for Regression, Counterfactual Estimation, Evaluation and Phenotyping with Censored Time-to-Events
http://autonlab.github.io/auton-survival
MIT License
315 stars 74 forks source link

Problems in DeepCoxMixture with possible solutions #106

Open braisCB opened 1 year ago

braisCB commented 1 year ago

When I used DeepCoxMixture in my synthetic data I found some problems:

  1. Patience is too low. It cannot be controlled by the fit method, so I had to manually changed it to 50. I also change the code a little bit in that part, so the patience only take into account the best result:

    var add2 = function(number) {
      if valcn > valc:
      patience_ += 1
    else:
      patience_ = 0
      valc = valcn
    }
  2. In some execution I get a SIGSEGV error. After some digging I found the error is caused by the UnivariateSpline module. I found the use of this spline causes some undesirable effects, like placing negative values. I have changed this module to the more stable Pchipinterpolator, which is able to preserve the monotony of the curve. I have obtained mode stable results with this approach. I have only changed the function:

def fit_spline(t, surv, s=1e-4):
  # return UnivariateSpline(t, surv, s=s, ext=3, k=1)
  return PchipInterpolator(t, surv)
  1. I also suggest to change the repair_probs function to prevent some infinite values that can appear:
    def repair_probs(probs):
    probs[torch.isnan(probs)] = -10
    probs[probs>10] = 10
    probs[probs<-10] = -10
    return probs
chiragnagpal commented 1 year ago

Hello @braisCB

I plan to re-release DCM with a much more stable implementation that should also potentially alleviate some of the issues you mention: Some of the changes I am planning to include are:

I am a bit occupied with my thesis completion right now, but I promise that I will get back to you in a couple of months time with updates.

Feel free to reach out to me at chiragn@cs.cmu.edu in the meantime.