Keras: Does keras have any plans to support multi-dimensional LSTM?

Created on 16 Oct 2015  ·  22Comments  ·  Source: keras-team/keras

Most helpful comment

so , does keras support multi-dimensional LSTM now ?

All 22 comments

You mean stacked LSTMs? Yes, it currently does. Also, you might want to ask this type of question on the keras-users google group.

@jmhessel No, I meant the LSTM described in this paper: http://arxiv.org/pdf/0705.2011.pdf

Oh, I see. I can't think of how that could be implemented at the moment, no. I don't really know about the plans, though.

No, if you are doing funky things like you are almost certainly better off working directly in Theano. There are assumptions in Keras that make it unsuitable for _certain_ types of research, and multi-dimensional RNNs in one of these cases.

What do you think about modifying DeepRNN such that?
1) Hidden layer matrix vector instead will be +1 dimension matrix with shape ((shape_hidden_layer_units), N - number of dimensions in the sequence)
2) Instead of accessing up to -depth steps, there will be only access the -size per each dimension on each step and taking only [(n_hidden_layer_units), nth dimension]

Does that sound feasible?

Sorry if it is not that clear and not well formulated, I can explain in depth if there is a need, I hope you can get the idea.

@davidbuniat that sounds very interesting! Could you elaborate it a little more?
Thanks!

@davidbuniat

@shampool Suppose you have an image (2D, with 300x400px). Reshape it into 1D vector (with 120,000px) on each rnn scan step access h-1 element and (h-400) element. Number 400 is based on how the reshape is done on your image. And you can expand this into multidimensional case.

I might be wrong, but seems scan supports multiple access to previous ones. I need MDRNN as well and I think to implement Grid LSTM which seems more powerful. In case of success in implementation let me know, I will as well.

@davidbuniat That sounds doable. If we make the taps fixed, things might be easier. But in certain types of traversal of the 2D grid. We may need taps to be able to chang over time. I am not sure if scan supports that.

Will let you know, if I finally make it work.

Thanks!

@davidbuniat

@davidbuniat
Wondering if you had positive results on this :
(2D, with 300x400px). Reshape it into 1D vector (with 120,000px)

No ,@arita297 as I said before I moved to Torch and I got positive results on MNIST dataset with 28x28 reshaping to 784px which I will agree is very far from 120,000px. Reshaping into 1D is just an idea how you could overcome Theano limitations. Furthermore, you might also consider to split the 120,000px into chunks and feed iteratively (should be very careful).

"No, if you are doing funky things like you are almost certainly better off working directly in Theano. There are assumptions in Keras that make it unsuitable for certain types of research, and multi-dimensional RNNs in one of these cases."

@fchollet : Is it thus pointless that I try to make my own layer of MD-LSTM, from existing implementation, fit the "build-your-own-layer" canvas ?

so , does keras support multi-dimensional LSTM now ?

+1

+1

I have a 2D implementation of several RNN, but they are pretty old and for pre-functional keras api. Will put it somewhere when I got time.

+1

:+1:

+1

+1

I really need to 2_dimentional LSTM in kers for my project and i have a little time,
Please give me this code
Thanks alot

Was this page helpful?
0 / 5 - 0 ratings