Compute the sampling distribution for temperature sampling: softmax(logits/T) for a positive temperature T, computed stably.
Implement solve(logits,temperature).
Returns. Return a NumPy vector of probabilities that sums to 1.
Example 1
Input:
solve([2.0, 1.0, 0.0], 1.0)
Output:
[0.665241, 0.244728, 0.090031]
Example 2
Input:
solve([2.0, 1.0, 0.0], 0.1)
Output:
[0.999955, 4.5e-05, 2.06106e-09]
Example 3
Input:
solve([2.0, 1.0, 0.0], 10.0)
Output:
[0.367165, 0.332225, 0.30061]
No results yet
Run your code to check it against the examples, or submit to run every test.