Created
March 10, 2018 14:07
-
-
Save NMZivkovic/8ef2ebbfae5cde2230b92c4da5ecb6d1 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
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