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

Function derivative_W

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

Source from the content-addressed store, hash-verified

68 return (Y - Yhat).sum()
69
70def derivative_W(X, Z, Y, Yhat, V):
71 # dZ = np.outer(Y - Yhat, V) * (1 - Z * Z) # this is for tanh activation
72 dZ = np.outer(Y - Yhat, V) * (Z > 0) # relu
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

Callers 1

updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected