From 79c2a76acaf24ff925ea5b909548f5c29e333e7f Mon Sep 17 00:00:00 2001 From: benhur98 Date: Thu, 7 Feb 2019 12:23:32 +0530 Subject: [PATCH 1/2] Update LSTM Demo.ipynb Syntax error fixed @ function forwardProp() as for i in range - in is missing and equals is missing @ self.oa[i] --- LSTM Demo.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LSTM Demo.ipynb b/LSTM Demo.ipynb index 6f131c4..a1c5a45 100644 --- a/LSTM Demo.ipynb +++ b/LSTM Demo.ipynb @@ -161,7 +161,7 @@ " \n", " #lets apply a series of matrix operations to our input (curr word) to compute a predicted output (next word)\n", " def forwardProp(self):\n", - " for i range(1, self.rl+1):\n", + " for i in range(1, self.rl+1):\n", " self.LSTM.x = np.hstack((self.ha[i-1], self.x))\n", " cs, hs, f, c, o = self.LSTM.forwardProp()\n", " #store computed cell state\n", @@ -171,7 +171,7 @@ " self.ai[i] = inp\n", " self.ac[i] = c\n", " self.ao[i] = o\n", - " self.oa[i] self.sigmoid(np.dot(self.w, hs))\n", + " self.oa[i] = self.sigmoid(np.dot(self.w, hs))\n", " self.x = self.eo[i-1]\n", " return self.oa\n", " \n", From 241a52070a13da6076fc41b46aa309b0b483d0b6 Mon Sep 17 00:00:00 2001 From: benhur98 Date: Thu, 7 Feb 2019 12:32:01 +0530 Subject: [PATCH 2/2] Update LSTM Demo.ipynb Line 166 , missing correct return values as cs, hs, f, inp, c, o = self.LSTM.forwardProp() --- LSTM Demo.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LSTM Demo.ipynb b/LSTM Demo.ipynb index a1c5a45..a5d87ad 100644 --- a/LSTM Demo.ipynb +++ b/LSTM Demo.ipynb @@ -163,7 +163,7 @@ " def forwardProp(self):\n", " for i in range(1, self.rl+1):\n", " self.LSTM.x = np.hstack((self.ha[i-1], self.x))\n", - " cs, hs, f, c, o = self.LSTM.forwardProp()\n", + " cs, hs, f, inp, c, o = self.LSTM.forwardProp()\n", " #store computed cell state\n", " self.ca[i] = cs\n", " self.ha[i] = hs\n",