Pytorch的nn.LSTM和Keras中LSTM对比

最近真的要被lstm整蒙了,一直理解不了,比如要3预测1,那么这个1怎么体现呢??

https://stackoverflow.com/questions/62204109/return-sequences-false-equivalent-in-pytorch-lstm

Pytorch:

https://blog.csdn.net/BigData_Mining/article/details/104390109   关于输入和输出讲的算比较清楚的了,没有之一。

nn,LSTM输入和输出的时间步都是seq_len,关键看用的时候怎么用,是多对多的用,还是多对1的用

 

Keras:

https://zhuanlan.zhihu.com/p/85910281

https://blog.csdn.net/computerlov/article/details/107397983

https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM

关键明白Keras中的return_sequencesreturn_state,就是跟h(t)和c(t)相关

 

posted @ 2021-07-03 14:53  vv_869  阅读(1366)  评论(0编辑  收藏  举报