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

Function softmax

nlp_class2/neural_network2.py:58–61  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

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

Callers 1

neural_network2.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected