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

Function derivative_w1

ann_class/xor_donut.py:48–52  ·  view source on GitHub ↗
(X, Z, T, Y, W2)

Source from the content-addressed store, hash-verified

46
47
48def derivative_w1(X, Z, T, Y, W2):
49 # dZ = np.outer(T-Y, W2) * Z * (1 - Z) # this is for sigmoid activation
50 # dZ = np.outer(T-Y, W2) * (1 - Z * Z) # this is for tanh activation
51 dZ = np.outer(T-Y, W2) * (Z > 0) # this is for relu activation
52 return X.T.dot(dZ)
53
54
55def derivative_b1(Z, T, Y, W2):

Callers 2

test_xorFunction · 0.70
test_donutFunction · 0.70

Calls

no outgoing calls

Tested by 2

test_xorFunction · 0.56
test_donutFunction · 0.56