Skip to content

Instantly share code, notes, and snippets.

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

  • Save SkalskiP/8be2a128d3bc6a5e444fe63c1167f9f8 to your computer and use it in GitHub Desktop.

Select an option

Save SkalskiP/8be2a128d3bc6a5e444fe63c1167f9f8 to your computer and use it in GitHub Desktop.
Full forward propagation
def full_forward_propagation(X, params_values, nn_architecture):
memory = {}
A_curr = X
for idx, layer in enumerate(nn_architecture):
layer_idx = idx + 1
A_prev = A_curr
activ_function_curr = layer["activation"]
W_curr = params_values["W" + str(layer_idx)]
b_curr = params_values["b" + str(layer_idx)]
A_curr, Z_curr = single_layer_forward_propagation(A_prev, W_curr, b_curr, activ_function_curr)
memory["A" + str(idx)] = A_prev
memory["Z" + str(layer_idx)] = Z_curr
return A_curr, memory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment