havakv / pycox

Survival analysis with PyTorch
BSD 2-Clause "Simplified" License
803 stars 188 forks source link

How to use dropout in eval_ #155

Open iuimaki opened 1 year ago

iuimaki commented 1 year ago

Hi, first of thank you so much for this great python package.

I am wondering how to approach the MC dropout in deepsurv model, i.e., keep the dropout active when evaluating testing data. I am very new to PyTorch and it is difficult for me to modify the source code. Many many thanks for any suggestions and instructions!!

sourasen1011 commented 1 year ago

Hi, I am trying to work this out as well. Haven't gotten around to it yet, but seems as (deceptively) simple as keeping model.train() as a way to prime the model for 'training' even while predicting. This way, the dropout layers remain active during prediction thereby resulting in some randomness, which can then be used to get ideas about the distributions.