Created
December 31, 2017 15:53
-
-
Save ArnoutDevos/29f6afb5b6da3091a7c4696e31f85004 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 step_backward(self, dnext_h, meta): | |
x, prev_h, next_h = meta | |
dtanh = dnext_h*(1.0-next_h**2) | |
dx = dtanh.dot(self.params[self.wx_name].T) | |
dprev_h = dtanh.dot(self.params[self.wh_name].T) | |
dWx = x.T.dot(dtanh) | |
dWh = prev_h.T.dot(dtanh) | |
db = np.sum(dtanh,axis=0) | |
return dx, dprev_h, dWx, dWh, db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment