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",