Explore Library
Code QuizIntermediate

Softmax as a Probability Distribution

Find why this softmax fails to produce a valid probability distribution.

Codepython
import numpy as np

def softmax(x):
    exps = np.exp(x)
    return exps / np.sum(x)

print(softmax(np.array([1.0, 2.0, 3.0])))

What is the bug in this softmax implementation?