havakv / pycox

Survival analysis with PyTorch
BSD 2-Clause "Simplified" License
780 stars 180 forks source link

Softmax layer and residual connections in DeepHitSingle model #169

Open Anivader opened 10 months ago

Anivader commented 10 months ago

Hi,

I am following this DeepHit tutorial for a single event - https://github.com/havakv/pycox/blob/master/examples/deephit.ipynb

In the model architecture, the "MLPVanilla" class inserts 2 hidden, linear layers. It seems like you don't have a "Softmax" layer at the end to obtain the survival probability distribution. Is this because it is already included in the loss function or do we not need to use it at all ?

net = tt.practical.MLPVanilla(in_features, num_nodes, out_features, batch_norm, dropout) model = DeepHitSingle(net, tt.optim.Adam, alpha=0.2, sigma=0.1, duration_index=labtrans.cuts)

Also, it seems like you are not implementing "residual connections " as mentioned in the DeepHit paper. Could you please explain the reason for this ?

Thanks Ani

shahidhaider-altis commented 7 months ago

You can use whatever pytorch network you want and use that for your net variable