Skip to content

Instantly share code, notes, and snippets.

@JoshVarty
Created April 2, 2019 20:06
Show Gist options
  • Save JoshVarty/03e55e39c0fda828c08c6d8730c81368 to your computer and use it in GitHub Desktop.
Save JoshVarty/03e55e39c0fda828c08c6d8730c81368 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