DeepSurv icon indicating copy to clipboard operation
DeepSurv copied to clipboard

partial log likelihood implementation

Open arjunascagnetto opened this issue 4 years ago • 0 comments

Hi all,

thanks for your interesting and very usefull work.

we have read your interesting paper "DeepSurv: Personalized Treatment Recommender System Using A Cox Proportional Hazards Deep Neural Network." . We are very interested in implementing your deep learning approach to survival analysis. Therefore we looked into your code on github and we have a question about the partial log likelihood implementation. In particular we don't understand where you are selecting the appropriate risk set depending on the specific event times when you apply the function T.extr_ops.cumsum() . In other words with respect to the following formula

\frac{1}{N_D} \sum_{i \in D}[F(x_i,\theta) - log(\sum_{j \in R_i} e^F(x_j,\theta))] - \lambda P(\theta)

where do you take into account the R_i in the code (loglikelihood calculation) ?

    risk = self.risk(deterministic)
    hazard_ratio = T.exp(risk)
    log_risk = T.log(T.extra_ops.cumsum(hazard_ratio))  <------ HERE
    uncensored_likelihood = risk.T - log_risk
    censored_likelihood = uncensored_likelihood * E

thanks, arjuna

arjunascagnetto avatar Jun 28 '21 14:06 arjunascagnetto