From 4db2fd6ae52177a41238bbdc83d13a0957621171 Mon Sep 17 00:00:00 2001 From: kjkimnb <42375495+kjkimnb@users.noreply.github.com> Date: Thu, 6 Feb 2025 14:11:12 +0800 Subject: [PATCH] Update rnn-scratch.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将训练代码的中文注释”state对于nn.LSTM或对于我们从零开始实现的模型是个张量“更正为:”state对于nn.LSTM或对于我们从零开始实现的模型是包含多个张量的元组“ --- chapter_recurrent-neural-networks/rnn-scratch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter_recurrent-neural-networks/rnn-scratch.md b/chapter_recurrent-neural-networks/rnn-scratch.md index 5d6da152b..bf379f3c7 100644 --- a/chapter_recurrent-neural-networks/rnn-scratch.md +++ b/chapter_recurrent-neural-networks/rnn-scratch.md @@ -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) @@ -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])