I'm using the CoxPH Model in my project, and trying to apply the corresponding Continuous-Time Loss function, CoxPHLoss, to calculate the loss. However, it got some errors. The output of my net (log_h) was (270, 10), the durations and events were both (270,). When the loss function called, the log_h would be changed into (2700,), and error occurred as follow:
RuntimeError: The size of tensor a (2700) must match the size of tensor b (270) at non-singleton dimension 0
Do you have any suggestions to help me fix this problem? Looking forward to your reply. Thanks for your time and your help.
Hi, Havard.
I'm using the CoxPH Model in my project, and trying to apply the corresponding Continuous-Time Loss function, CoxPHLoss, to calculate the loss. However, it got some errors. The output of my net (log_h) was (270, 10), the durations and events were both (270,). When the loss function called, the log_h would be changed into (2700,), and error occurred as follow:
RuntimeError: The size of tensor a (2700) must match the size of tensor b (270) at non-singleton dimension 0
Do you have any suggestions to help me fix this problem? Looking forward to your reply. Thanks for your time and your help.