Created
February 26, 2019 17:13
-
-
Save marcopeix/ce72a6458fe412faa7f03b346af23594 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
def linear_activation_forward(A_prev, W, b, activation): | |
if activation == "sigmoid": | |
Z, linear_cache = linear_forward(A_prev, W, b) | |
A, activation_cache = sigmoid(Z) | |
elif activation == "relu": | |
Z, linear_cache = linear_forward(A_prev, W, b) | |
A, activation_cache = relu(Z) | |
assert (A.shape == (W.shape[0], A_prev.shape[1])) | |
cache = (linear_cache, activation_cache) | |
return A, cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment