Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created March 10, 2018 14:07
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 NMZivkovic/8ef2ebbfae5cde2230b92c4da5ecb6d1 to your computer and use it in GitHub Desktop.
Save NMZivkovic/8ef2ebbfae5cde2230b92c4da5ecb6d1 to your computer and use it in GitHub Desktop.
import numpy as np
class RNN:
def step(self, x):
# Update the state
self.h = np.tanh(np.dot(self.W_hh, self.h) + np.dot(self.W_xh, x))
# Calculate the output
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