graykode / graykode/nlp-tutorial

The comment in the Bi-LSTM (Attention) model has an issue.

Open
#84 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
14.9k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

The comment `# output : [batch_size, len_seq, n_hidden]` should indeed be corrected to `# output : [batch_size, len_seq, n_hidden*2]` because the Bi-LSTM model is bidirectional. In a bidirectional LSTM, the hidden size is effectively doubled, as it concatenates the forward and backward hidden states. Therefore, the correct shape of the `output` after permutation is `[batch_size, len_seq, n_hidden * 2]`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.