zylbuaa / PIBD

[ICLR 2024]Implementation of "Prototypical Information Bottlenecking and Disentangling for Multimodal Cancer Survival Prediction"
43 stars 5 forks source link

Log operation in CLUB loss #4

Open siyi-wind opened 5 months ago

siyi-wind commented 5 months ago

Thanks for sharing the code! I have one question about the CLUB loss. In the paper, the club loss is based on log(q(y|x)), but in your code https://github.com/zylbuaa/PIBD/blob/main/models/club.py Line 111 and Line 117 positive = - (mu - y_samples) ** 2 / 2. negative = - ((y_samples_1 - prediction_1) ** 2).mean(dim=1) / 2.

There is no log operation. I'm wondering how did you calculate those losses.

siyi-wind commented 5 months ago

In addition, do you use L{CLUB} and L{estimator} to update all the parameters?

zylbuaa commented 4 months ago

Hi, Siyi

Thank you for your interest in our work! For the implementation of CLUB, you can refer to the supplementary section of the original paper (https://arxiv.org/abs/2006.12013), the implementation details of vCLUB. It explains how to calculate the log-ratio.

Regarding your other question, yes, we use them to update all the parameters. We found this setup to be simpler and more stable during the training process.

siyi-wind commented 4 months ago

I see. Thank you very much!