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

Function derivative_b1

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

Source from the content-addressed store, hash-verified

53
54
55def derivative_b1(Z, T, Y, W2):
56 # dZ = np.outer(T-Y, W2) * Z * (1 - Z) # this is for sigmoid activation
57 # dZ = np.outer(T-Y, W2) * (1 - Z * Z) # this is for tanh activation
58 dZ = np.outer(T-Y, W2) * (Z > 0) # this is for relu activation
59 return dZ.sum(axis=0)
60
61
62def get_log_likelihood(T, Y):

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