MCPcopy Create free account
hub / github.com/apache/singa / softmax

Function softmax

examples/onnx/tiny_yolov2.py:54–56  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

52 return x * (1 - x) if derivative else 1 / (1 + np.exp(-x))
53
54 def softmax(x):
55 scoreMatExp = np.exp(np.asarray(x))
56 return scoreMatExp / scoreMatExp.sum(0)
57
58 clut = [(0, 0, 0), (255, 0, 0), (255, 0, 255), (0, 0, 255), (0, 255, 0),
59 (0, 255, 128), (128, 255, 0), (128, 128, 0), (0, 128, 255),

Callers 1

postprcessFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected