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

Function derivative_b

ann_class/regression.py:75–78  ·  view source on GitHub ↗
(Z, Y, Yhat, V)

Source from the content-addressed store, hash-verified

73 return X.T.dot(dZ)
74
75def derivative_b(Z, Y, Yhat, V):
76 # dZ = np.outer(Y - Yhat, V) * (1 - Z * Z) # this is for tanh activation
77 dZ = np.outer(Y - Yhat, V) * (Z > 0) # this is for relu activation
78 return dZ.sum(axis=0)
79
80def update(X, Z, Y, Yhat, W, b, V, c, learning_rate=1e-4):
81 gV = derivative_V(Z, Y, Yhat)

Callers 1

updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected