I was trying to understand why the concordance index was inconsistent when calculating from a loaded model (see this comment here) and discovered this problem: model.X and model.partial_hazard are not correctly saved in save_model.
How to replicate:
Run DeepSurv Example jupyter notebook
Save the trained model with model.save_model('bestparams.json', weights_file='bestweights.h5')
Load the model with model2 = deepsurv.deep_surv.load_model_from_json('bestparams.json', weights_fp='bestweights.h5')
In one cell, run the following repeatedly. Notice that with the original model, partial_hazards is consistent.
This results in an inconsistent concordance index, since you must compute the hazards to get the concordance. I have tried to fix it myself but I don't think I understand Theano tensors well enough. Hope this can be addressed soon.
I was trying to understand why the concordance index was inconsistent when calculating from a loaded model (see this comment here) and discovered this problem: model.X and model.partial_hazard are not correctly saved in save_model.
How to replicate:
model.save_model('bestparams.json', weights_file='bestweights.h5')
model2 = deepsurv.deep_surv.load_model_from_json('bestparams.json', weights_fp='bestweights.h5')
This results in an inconsistent concordance index, since you must compute the hazards to get the concordance. I have tried to fix it myself but I don't think I understand Theano tensors well enough. Hope this can be addressed soon.