temperature_scaling icon indicating copy to clipboard operation
temperature_scaling copied to clipboard

Why do we need to expand temperature to match the size of logits?

Open FatPandao opened this issue 3 years ago • 0 comments

In your code

# Expand temperature to match the size of logits
temperature = self.temperature.unsqueeze(1).expand(logits.size(0), logits.size(1))
return logits / temperature

Why not just doing something like

return logits / self.temperature

FatPandao avatar Oct 13 '21 19:10 FatPandao