Applies temperature scaling to a probability distribution using the softmax function.
Arguments
- w
A numeric vector of probabilities that must sum to 1. All values must be between 0 and 1 (inclusive). The function will validate that the sum equals 1 within floating-point precision (tolerance of 1e-10).
- temp
A single numeric value specifying the temperature parameter. Must be non-negative (>= 0).
temp > 1: Makes the distribution more uniform (smoother, less peaked)temp < 1: Makes the distribution less uniform (sharper, more peaked)temp = 1: No change to the original distributiontemp = 0: Returns a vector with 1 at the position of the maximum probability and 0 otherwise