Skip to content

Instantly share code, notes, and snippets.

@SkalskiP
Last active October 8, 2018 22:49
Show Gist options
  • Select an option

  • Save SkalskiP/5e260ace2a68ff2b4e901b9b2eb222d4 to your computer and use it in GitHub Desktop.

Select an option

Save SkalskiP/5e260ace2a68ff2b4e901b9b2eb222d4 to your computer and use it in GitHub Desktop.
Single layer forward propagation step
def single_layer_forward_propagation(A_prev, W_curr, b_curr, activation="relu"):
Z_curr = np.dot(W_curr, A_prev) + b_curr
if activation is "relu":
activation_func = relu
elif activation is "sigmoid":
activation_func = sigmoid
else:
raise Exception('Non-supported activation function')
return activation_func(Z_curr), Z_curr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment