ShusenTang / Dive-into-DL-PyTorch

本项目将《动手学深度学习》(Dive into Deep Learning)原书中的MXNet实现改为PyTorch实现。
http://tangshusen.me/Dive-into-DL-PyTorch
Apache License 2.0
18.25k stars 5.39k forks source link

6.4节的 rnn(input,state,params) 函数理解 #147

Open Kittywyk opened 4 years ago

Kittywyk commented 4 years ago

请问其中的 H,=state 怎么理解? ,=是什么意思? 请问最后 return outputs, (H,) 中的 (H,) 又该如何理解?

ShusenTang commented 4 years ago

(H, )代表这是一个只有一个元素H的tuple,写成这种形式是为了保持state是一个tuple的习惯,没有特殊含义

Kittywyk commented 4 years ago

好的,谢谢

------------------ 原始邮件 ------------------ 发件人: "ShusenTang/Dive-into-DL-PyTorch" <notifications@github.com>; 发送时间: 2020年7月15日(星期三) 下午5:35 收件人: "ShusenTang/Dive-into-DL-PyTorch"<Dive-into-DL-PyTorch@noreply.github.com>; 抄送: "KunyuanW"<987663694@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [ShusenTang/Dive-into-DL-PyTorch] 6.4节的 rnn(input,state,params) 函数理解 (#147)

(H, )代表这是一个只有一个元素H的tuple,写成这种形式是为了保持state是一个tuple的习惯,没有特殊含义

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.