Last active
May 30, 2020 17:21
-
-
Save SkalskiP/90e723f989f302a9f668055c1eeb8521 to your computer and use it in GitHub Desktop.
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._a_prev = np.array(a_prev, copy=True) | |
return np.dot(a_prev, self._w.T) + self._b | |
def backward_pass(self, da_curr: np.array) -> np.array: | |
n = self._a_prev.shape[0] | |
self._dw = np.dot(da_curr.T, self._a_prev) / n | |
self._db = np.sum(da_curr, axis=0, keepdims=True) / n | |
return np.dot(da_curr, self._w) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment