wetliu / energy_ood

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About temperature

Z-MU-Z opened this issue · comments

Hi,
When I adjust the temperature, I observe a change in the relationship between the distributions. Specifically, when temperature=0.1, E(logitsA) is initially greater than E(logitsB), but when temperature=10, E(logitsA) becomes less than E(logitsB).

I use temp * torch.logsumexp(logits[:, :num_category] / temp, dim=1) to computer energy E()

logits = torch.randn(7, num_category)  
energy = temp * torch.logsumexp(logits[:, :num_category] / temp, dim=1)

Am I misunderstanding or implementing it incorrectly? I understand that temperature is only for smoothing and should not change the relative relationships, right?

It is not just smoothing. The figure with temperature changes vs the FPR95 shows the relative different does change.