Last active
May 23, 2020 17:01
-
-
Save SkalskiP/b943b568976fc4bbb47ed024ce02a071 to your computer and use it in GitHub Desktop.
Flatten layer
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._shape = a_prev.shape | |
return np.ravel(a_prev).reshape(a_prev.shape[0], -1) | |
def backward_pass(self, da_curr: np.array) -> np.array: | |
return da_curr.reshape(self._shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment