双向LSTM和LSTM有什么区别? [英] What's the difference between a bidirectional LSTM and an LSTM?

查看:3832
本文介绍了双向LSTM和LSTM有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释一下吗?我知道双向LSTM具有向前和向后的传递,但是与单向LSTM相比,这样做有什么优势?

Can someone please explain this? I know bidirectional LSTMs have a forward and backward pass but what is the advantage of this over a unidirectional LSTM?

每个人最适合什么?

推荐答案

LSTM的核心是使用隐藏状态保留已经通过它的输入中的信息.

LSTM in its core, preserves information from inputs that has already passed through it using the hidden state.

单向LSTM仅保留过去的信息,因为它只能看到过去的信息.

Unidirectional LSTM only preserves information of the past because the only inputs it has seen are from the past.

使用双向将以两种方式运行您的输入,一种从过去到将来,另一种从将来到过去,这种方法与单向的不同之处在于,在向后运行的LSTM中,您保留了未来的信息并结合使用两个隐藏状态,您可以在任何时间点保存过去和将来的信息.

Using bidirectional will run your inputs in two ways, one from past to future and one from future to past and what differs this approach from unidirectional is that in the LSTM that runs backwards you preserve information from the future and using the two hidden states combined you are able in any point in time to preserve information from both past and future.

它们所适合的是一个非常复杂的问题,但是BiLSTM表现出了很好的结果,因为它们可以更好地理解上下文,我将尝试通过一个示例进行解释.

What they are suited for is a very complicated question but BiLSTMs show very good results as they can understand context better, I will try to explain through an example.

让我们说我们试图在一个高水平上预测一个句子中的下一个单词

Lets say we try to predict the next word in a sentence, on a high level what a unidirectional LSTM will see is

男孩们去了....

The boys went to ....

并且将尝试仅在这种情况下预测下一个单词,例如,使用双向LSTM,您将能够看到更远的信息

And will try to predict the next word only by this context, with bidirectional LSTM you will be able to see information further down the road for example

转发LSTM:

男孩们去了...

The boys went to ...

向后LSTM:

...然后他们离开了泳池

... and then they got out of the pool

您可以看到,使用将来的信息,网络可能会更容易理解下一个单词是什么.

You can see that using the information from the future it could be easier for the network to understand what the next word is.

这篇关于双向LSTM和LSTM有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆