Skip to content
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