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

查看:80
本文介绍了双向 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 中,您可以保留未来的信息strong> 并结合使用两个隐藏状态,您可以在任何时间点保留过去和未来的信息.

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.

假设我们尝试预测一个句子中的下一个单词,在高层次上单向 LSTM 将看到的是

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:

男孩们去了……

后向 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天全站免登陆