Skip to content

Commit

Permalink
double review (d2l-ai#1016)
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmermaid authored Nov 17, 2021
1 parent 39d53c3 commit 86afa3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion chapter_recurrent-modern/bi-rnn.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ $$
\end{aligned}
$$

其中,权重$\mathbf{W}_{xh}^{(f)} \in \mathbb{R}^{d \times h}, \mathbf{W}_{hh}^{(f)} \in \mathbb{R}^{h \times h}, \mathbf{W}_{xh}^{(b)} \in \mathbb{R}^{d \times h}, \mathbf{W}_{hh}^{(b)} \in \mathbb{R}^{h \times h}$ 和偏置$\mathbf{b}_h^{(f)} \in \mathbb{R}^{1 \times h}, \mathbf{b}_h^{(b)} \in \mathbb{R}^{1 \times h}$都是模型参数。
其中,权重$\mathbf{W}_{xh}^{(f)} \in \mathbb{R}^{d \times h}, \mathbf{W}_{hh}^{(f)} \in \mathbb{R}^{h \times h}, \mathbf{W}_{xh}^{(b)} \in \mathbb{R}^{d \times h}, \mathbf{W}_{hh}^{(b)} \in \mathbb{R}^{h \times h}$
和偏置$\mathbf{b}_h^{(f)} \in \mathbb{R}^{1 \times h}, \mathbf{b}_h^{(b)} \in \mathbb{R}^{1 \times h}$都是模型参数。

接下来,将前向隐状态$\overrightarrow{\mathbf{H}}_t$
和反向隐状态$\overleftarrow{\mathbf{H}}_t$连接起来,
Expand Down
4 changes: 2 additions & 2 deletions chapter_recurrent-modern/machine-translation-and-dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ def load_data_nmt(batch_size, num_steps, num_examples=600):
train_iter, src_vocab, tgt_vocab = load_data_nmt(batch_size=2, num_steps=8)
for X, X_valid_len, Y, Y_valid_len in train_iter:
print('X:', d2l.astype(X, d2l.int32))
print('valid lengths for X:', X_valid_len)
print('X的有效长度:', X_valid_len)
print('Y:', d2l.astype(Y, d2l.int32))
print('valid lengths for Y:', Y_valid_len)
print('Y的有效长度:', Y_valid_len)
break
```

Expand Down

0 comments on commit 86afa3d

Please sign in to comment.