def forwardPropagate(X, W1, b1, W2, b2):
## YOUR CODE HERE ##
Z1 = 0
Z2 = 0
S1 = 0
S2 = 0
## Here we should find 2 result: first for input and hidden layer then for hidden and output layer.
## First I found the result for every node in hidden layer then put them into activation function.
S1 = np.dot(X, W1)+ b1
Z1 = calcActivation(S1)
## Second I found the result for every node in output layer then put them into activation function.
S2 = np.dot(Z1, W2) + b2
Z2 = calcActivation(S2)
####################
return Z1, Z2
# calculate the cost
评论列表
文章目录