Created
May 23, 2020 17:05
-
-
Save SkalskiP/66b0581b8637508dd4e128a1f2cb2611 to your computer and use it in GitHub Desktop.
Relu
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 forward_pass(self, a_prev: np.array) -> np.array: | |
self._z = np.maximum(0, a_prev) | |
return self._z | |
def backward_pass(self, da_curr: np.array) -> np.array: | |
dz = np.array(da_curr, copy=True) | |
dz[self._z <= 0] = 0 | |
return dz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment