MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / softmax

Function softmax

nlp_class2/logistic.py:56–59  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

54 lr = 1e-1
55
56 def softmax(a):
57 a = a - a.max()
58 exp_a = np.exp(a)
59 return exp_a / exp_a.sum(axis=1, keepdims=True)
60
61 # what is the loss if we set W = log(bigram_probs)?
62 W_bigram = np.log(bigram_probs)

Callers 1

logistic.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected