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

Function forward

ann_class/backprop.py:17–22  ·  view source on GitHub ↗
(X, W1, b1, W2, b2)

Source from the content-addressed store, hash-verified

15np.random.seed(1)
16
17def forward(X, W1, b1, W2, b2):
18 Z = 1 / (1 + np.exp(-X.dot(W1) - b1))
19 A = Z.dot(W2) + b2
20 expA = np.exp(A)
21 Y = expA / expA.sum(axis=1, keepdims=True)
22 return Y, Z
23
24
25# determine the classification rate

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected