From bccde19971580a74818b807a176a733f28527817 Mon Sep 17 00:00:00 2001 From: Anton Petnitsky <168552591+Mukller@users.noreply.github.com> Date: Thu, 9 Jul 2026 05:19:07 +0300 Subject: [PATCH] fix: correct output shape comment in Bi-LSTM(Attention) --- 4-3.Bi-LSTM(Attention)/Bi-LSTM(Attention).py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4-3.Bi-LSTM(Attention)/Bi-LSTM(Attention).py b/4-3.Bi-LSTM(Attention)/Bi-LSTM(Attention).py index 7ff6365..09833dd 100644 --- a/4-3.Bi-LSTM(Attention)/Bi-LSTM(Attention).py +++ b/4-3.Bi-LSTM(Attention)/Bi-LSTM(Attention).py @@ -34,7 +34,7 @@ def forward(self, X): # final_hidden_state, final_cell_state : [num_layers(=1) * num_directions(=2), batch_size, n_hidden] output, (final_hidden_state, final_cell_state) = self.lstm(input, (hidden_state, cell_state)) - output = output.permute(1, 0, 2) # output : [batch_size, len_seq, n_hidden] + output = output.permute(1, 0, 2) # output : [batch_size, len_seq, n_hidden * num_directions(=2)] attn_output, attention = self.attention_net(output, final_hidden_state) return self.out(attn_output), attention # model : [batch_size, num_classes], attention : [batch_size, n_step]