海晨威:一幅图真正理解LSTM的物理结构zhuanlan.zhihu.com
![cef3c2d317fa6ef7afd7caa370d8e670.png](https://img-blog.csdnimg.cn/img_convert/cef3c2d317fa6ef7afd7caa370d8e670.png)
![a08002650f6cdc4cafb170ece8eda18e.png](https://img-blog.csdnimg.cn/img_convert/a08002650f6cdc4cafb170ece8eda18e.png)
这个是网上看的最多的图了,但是在理解lstm的应用过程中的时候这个图带来了不少麻烦。
![6d696c9fafe89e3bfe0c87f79f2aa4dc.png](https://img-blog.csdnimg.cn/img_convert/6d696c9fafe89e3bfe0c87f79f2aa4dc.png)
展开之后实际的物理结构是这样的,1、2图同颜色的点代表了同一个东西;
问题1:
![6ecd4bcc50946a0e46336a1f0f699c11.png](https://img-blog.csdnimg.cn/img_convert/6ecd4bcc50946a0e46336a1f0f699c11.png)
这里的输入xt和ht是怎么结合的?比如:
![cadc6330049edc4d6d1083036777bd21.png](https://img-blog.csdnimg.cn/img_convert/cadc6330049edc4d6d1083036777bd21.png)
这块儿很多地方都没讲清楚,实际上就是concat,直接concat起来了:
![175b346680575ee688f2995ff6333230.png](https://img-blog.csdnimg.cn/img_convert/175b346680575ee688f2995ff6333230.png)
问题2:LSTM的权重到底是啥样的?
这里直接以tf.keras的代码为例子看看就造了:
def build_model(look_back: int, batch_size: