Skip to content

Instantly share code, notes, and snippets.

@JoshVarty
Created April 2, 2019 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshVarty/508bf0317447541b4c37cd797d574624 to your computer and use it in GitHub Desktop.
Save JoshVarty/508bf0317447541b4c37cd797d574624 to your computer and use it in GitHub Desktop.
class RNN:
# ...
def step(self, x):
# update the hidden state
self.h = np.tanh(np.dot(self.W_hh, self.h) + np.dot(self.W_xh, x))
# compute the output vector
y = np.dot(self.W_hy, self.h)
return y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment