(x)
| 16 | # -> squashes the output to be between 0 and 1 = probability |
| 17 | # sum of all probabilities is 1 |
| 18 | def softmax(x): |
| 19 | return np.exp(x) / np.sum(np.exp(x), axis=0) |
| 20 | |
| 21 | x = np.array([2.0, 1.0, 0.1]) |
| 22 | outputs = softmax(x) |
no outgoing calls
no test coverage detected