Herschel555 / CAML

repository for CAML: Correlation-aware mutual learning for semi-supervised medical image segmentation
31 stars 1 forks source link

Cosine similarity #6

Open llyyyll opened 4 months ago

llyyyll commented 4 months ago

Thanks for your great work. I would like to ask what part of the code the cosine similarity calculation is specifically embodied in?

Herschel555 commented 4 months ago

Hi! You can check https://github.com/Herschel555/CAML/blob/master/code/utils/correlation.py#L24, which is a conventional way to achieve similarity calculation.

llyyyll commented 3 months ago

Thank you for your answer. I have one more question, in the https://github.com/Herschel555/CAML/blob/b63547927eef5b7ae47bd62452e28517d13545e4/code/train_caml.py#L260, why do you do logarithmic operations on corr_v instead of corr_a when calculating cross-entropy

Thank you!

Herschel555 commented 3 months ago

It can be seen that we choose corr_a as the label to supervise corr_v as the prediction.