Scaling of Class-wise Training Losses for Post-hoc Calibration