ShusenTang / Dive-into-DL-PyTorch

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

gru章节代码是否有误 #88

Closed orangerfun closed 4 years ago

orangerfun commented 4 years ago

gru 在定义模型函数里

H_tilda = torch.tanh(torch.matmul(X, W_xh) + R *torch.matmul(H, W_hh) + b_h)

应该改成:

H_tilda = torch.tanh(torch.matmul(X, W_xh) + torch.matmul((R*H), W_hh) + b_h)
ShusenTang commented 4 years ago

你说得对,感谢提醒,已更正。