MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / custom_softmax

Function custom_softmax

cnn_class2/test_softmax.py:13–17  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

11import keras.backend as K
12
13def custom_softmax(x):
14 m = tf.reduce_max(x, 1)
15 x = x - m
16 e = tf.exp(x)
17 return e / tf.reduce_sum(e, -1)
18
19
20a = np.random.randn(1, 1000)

Callers 1

test_softmax.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected