From 05c42621d081dc6aea8e0025e503eeee85206532 Mon Sep 17 00:00:00 2001 From: Guillaume Alleon Date: Sun, 14 Feb 2021 15:06:19 +0100 Subject: [PATCH] Update Chapter_4.ipynb Replacing `self.num_driections` by `self.num_directions` --- Chapter_4.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chapter_4.ipynb b/Chapter_4.ipynb index 2767a00..5432997 100644 --- a/Chapter_4.ipynb +++ b/Chapter_4.ipynb @@ -1052,9 +1052,9 @@ " super(LastTimeStep, self).__init__()\n", " self.rnn_layers = rnn_layers\n", " if bidirectional:\n", - " self.num_driections = 2\n", + " self.num_directions = 2\n", " else:\n", - " self.num_driections = 1 \n", + " self.num_directions = 1 \n", " \n", " def forward(self, input):\n", " #Result is either a tupe (out, h_t)\n", @@ -1065,7 +1065,7 @@ " last_step = last_step[0]#then h_t is the first item in the tuple\n", " batch_size = last_step.shape[1] #per docs, shape is: '(num_layers * num_directions, batch, hidden_size)'\n", " #reshaping so that everything is separate \n", - " last_step = last_step.view(self.rnn_layers, self.num_driections, batch_size, -1)\n", + " last_step = last_step.view(self.rnn_layers, self.num_directions, batch_size, -1)\n", " #We want the last layer's results\n", " last_step = last_step[self.rnn_layers-1] \n", " #Re order so batch comes first\n",