Skip to content

Instantly share code, notes, and snippets.

@muhammadgaffar
Created October 24, 2018 15:21
Show Gist options
  • Save muhammadgaffar/f820ff61788477cad465dd074e0dc95f to your computer and use it in GitHub Desktop.
Save muhammadgaffar/f820ff61788477cad465dd074e0dc95f to your computer and use it in GitHub Desktop.
def linear_activation_backward(dA, cache, activation):
linear_cache, activation_cache = cache
if activation == "relu":
dZ = relu_backward(dA, activation_cache)
dA_prev, dW, db = linear_backward(dZ, linear_cache)
elif activation == "sigmoid":
dZ = sigmoid_backward(dA, activation_cache)
dA_prev, dW, db = linear_backward(dZ, linear_cache)
return dA_prev, dW, db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment