Last active
October 8, 2018 22:49
-
-
Save SkalskiP/5e260ace2a68ff2b4e901b9b2eb222d4 to your computer and use it in GitHub Desktop.
Single layer forward propagation step
This file contains hidden or 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 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