liupei101 / TFDeepSurv

COX Proportional risk model and survival analysis implemented by tensorflow.
MIT License
99 stars 27 forks source link

loss diverges to NaN #15

Closed minxueric closed 1 year ago

minxueric commented 1 year ago

In the _create_loss function, the loss_breslow is something divided by Obs. However the variable Obs is the count of events in a batch, which is likely to be 0.

How do you solve this problem?

liupei101 commented 1 year ago

Maybe you can try to add some codes to manually skip the batch if you found that there is no event observation in this batch.