Skip to content

Instantly share code, notes, and snippets.

@SuvroBaner
Created December 31, 2019 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SuvroBaner/2ac8542c3d0f388a197e2a6b81983e99 to your computer and use it in GitHub Desktop.
Save SuvroBaner/2ac8542c3d0f388a197e2a6b81983e99 to your computer and use it in GitHub Desktop.
def forward_propagation(X, parameters):
# Retrieve the parameters from the dictionary "parameters"
W1 = parameters['W1']
b1 = parameters['b1']
W2 = parameters['W2']
b2 = parameters['b2']
W3 = parameters['W3']
b3 = parameters['b3']
Z1 = tf.add(tf.matmul(W1, X), b1)
A1 = tf.nn.relu(Z1)
Z2 = tf.add(tf.matmul(W2, A1), b2)
A2 = tf.nn.relu(Z2)
Z3 = tf.add(tf.matmul(W3, A2), b3)
return Z3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment