NN.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:MachineLearningProjects 作者: geallen 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号