Understanding temperature tuning in energy-based models