Skip to content

Commit f92a484

Browse files
author
Lazy Programmer
committed
Merge branch 'master' of github.com:lazyprogrammer/machine_learning_examples
2 parents 1eac9e1 + fcf56fd commit f92a484

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ann_class/forwardprop.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def sigmoid(a):
4040
return 1 / (1 + np.exp(-a))
4141

4242
def forward(X, W1, b1, W2, b2):
43-
Z = sigmoid(X.dot(W1) + b1)
43+
Z = sigmoid(X.dot(W1) + b1) # sigmoid
44+
# Z = np.tanh(X.dot(W1) + b1) # tanh
45+
# Z = np.maximum(X.dot(W1) + b1) # relu
4446
A = Z.dot(W2) + b2
4547
expA = np.exp(A)
4648
Y = expA / expA.sum(axis=1, keepdims=True)

0 commit comments

Comments
 (0)