Skyy93 / Sample4Geo

76 stars 10 forks source link

About The InfoNCE Loss temperature parameter Setting of τ #8

Closed wlfxy closed 8 months ago

wlfxy commented 8 months ago

Thank you very much for your paper and code, and I would like to ask you about The InfoNCE Loss Does temperature parameter τ have an initial value? According to the thesis, it is a learnable parameter. How does it learn by itself

Skyy93 commented 8 months ago

Thank you for your interest in our work. We set the temperature parameter in the model.py to

self.logit_scale = torch.nn.Parameter(torch.ones([]) * np.log(1 / 0.07))

Since we use it in the loss calculation we can learn it.

wlfxy commented 8 months ago

Thank you for your answer