Skip to content

Instantly share code, notes, and snippets.

@akarsh-saxena
Last active May 21, 2020 21:32
Show Gist options
  • Save akarsh-saxena/aceb9dfe1bc29868d125725b9412a130 to your computer and use it in GitHub Desktop.
Save akarsh-saxena/aceb9dfe1bc29868d125725b9412a130 to your computer and use it in GitHub Desktop.
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