Created
August 29, 2020 16:07
-
-
Save PyDataBlog/8b52151100e6614cb174dbb5b955815f to your computer and use it in GitHub Desktop.
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
| """ | |
| Derivative of the Sigmoid function. | |
| """ | |
| function sigmoid_backwards(∂A, activated_cache) | |
| s = sigmoid(activated_cache).A | |
| ∂Z = ∂A .* s .* (1 .- s) | |
| @assert (size(∂Z) == size(activated_cache)) | |
| return ∂Z | |
| end | |
| """ | |
| Derivative of the ReLU function. | |
| """ | |
| function relu_backwards(∂A, activated_cache) | |
| return ∂A .* (activated_cache .> 0) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment