Last active
May 21, 2020 21:32
-
-
Save akarsh-saxena/aceb9dfe1bc29868d125725b9412a130 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def forward_prop(X, params): | |
"""Performs forward propagation and calculates output value | |
Arguments | |
--------- | |
X: array_like | |
Data | |
params: dictionary | |
Parameter dict contaning 'w' and 'b' | |
Returns | |
------- | |
dict | |
Dictionary contaning 'z' and 'a' | |
""" | |
w = params['w'] | |
b = params['b'] | |
z = np.dot(X, w) + b | |
a = sigmoid(z) | |
return {'z': z, 'a': a} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment