havakv / pycox

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

L1 and L2 penalty coxph #158

Open Cesco16 opened 1 year ago

Cesco16 commented 1 year ago

Hi,

thank you very much for this amazing package! Is there a way to add L1 and L2 penalty to coxph loss? Thank you in advance!

shahidhaider-altis commented 7 months ago

L2 weight decay is already added if you use an Adam Optimizer

If you want to implement L1, I have found the torchlayers library makes this possible