FunctionRacerProblemsRace

Softmax Weights

EasyNumPyPython

Turn scores into probabilities: compute e ** score for every score (np.exp) and divide each by the sum of all of them, so the results add up to 1. Return the array of probabilities.

Example 1

scores [0,0]
returns [0.5,0.5]

Equal scores give equal shares: [0.5, 0.5].

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems