Apply softmax with a temperature to a vector of logits: divide the logits by temperature, then take a numerically stable softmax. The temperature must be positive.
Implement solve(logits,temperature).
Returns. Return a NumPy vector of probabilities that sums to 1.
Example 1
Input:
solve([1.0, 2.0, 3.0], 1.0)
Output:
[0.090031, 0.244728, 0.665241]
Example 2
Input:
solve([1.0, 2.0, 3.0], 0.5)
Output:
[0.015876, 0.11731, 0.866813]
Example 3
Input:
solve([1.0, 2.0, 3.0], 100.0)
Output:
[0.330006, 0.333322, 0.336672]
No results yet
Run your code to check it against the examples, or submit to run every test.