Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rnn-scratch.md #1370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapter_recurrent-neural-networks/rnn-scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def train_epoch_ch8(net, train_iter, loss, updater, device, use_random_iter):
# state对于nn.GRU是个张量
state.detach_()
else:
# state对于nn.LSTM或对于我们从零开始实现的模型是个张量
# state对于nn.LSTM或对于我们从零开始实现的模型是包含多个张量的元组
for s in state:
s.detach_()
y = Y.T.reshape(-1)
Expand Down Expand Up @@ -785,7 +785,7 @@ def train_epoch_ch8(net, train_iter, loss, updater, device, use_random_iter):
# state对于nn.GRU是个张量
state.stop_gradient=True
else:
# state对于nn.LSTM或对于我们从零开始实现的模型是个张量
# state对于nn.LSTM或对于我们从零开始实现的模型是包含多个张量的元组
for s in state:
s.stop_gradient=True
y = paddle.reshape(Y.T,shape=[-1])
Expand Down
Loading