Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alternative way of concatenating two LSTM cell #10

Closed
un-lock-me opened this issue Feb 20, 2019 · 6 comments
Closed

alternative way of concatenating two LSTM cell #10

un-lock-me opened this issue Feb 20, 2019 · 6 comments

Comments

@un-lock-me
Copy link

Hello again:)

I am working on your code and almost done. except I need to change one line of the code:
rnn2_merged = concatenate([rnn_2, rnn_2b]) in which you are concatenating them.
Can you please help me with this. I want to keep the same structure but without Concatenate?
to put it another way, what will be the alternative way of concatenating them in keras but without using concatenate?

Thanks for taking the time.

@sbillburg
Copy link
Owner

Keras is tensorflow-based, so you can use functions from tensorflow to concatenate two tensors together.

@un-lock-me
Copy link
Author

Could you please share a link with me in which doing this?
I just want to make sure my revised code will be exactly the same as code here.

Thanks in advance:)

@sbillburg
Copy link
Owner

Could you please share a link with me in which doing this?
I just want to make sure my revised code will be exactly the same as code here.

Thanks in advance:)

https://apimirror.com/tensorflow~python/tf/concat

Or you can look for concatenate function in Keras source code, as a reference.

@un-lock-me
Copy link
Author

It did not help actually, Im trying to convert your code to CoreMl, but CoreMl does not support concatenate!
this guy changed his code vsyw/Keras-OpenFace#1 to change the channel to be able to do so.
Can you please have a look to see if it is doable on your code?

@un-lock-me
Copy link
Author

un-lock-me commented Feb 23, 2019

Can you please let me know about this?
here rnn2_merged = concatenate([rnn_2, rnn_2b])
the dimension of rnn_2 = (?, ?, 128)
and rnn_2b= (?, ?, 128)
is there anyway we can give the actual size to rnn_2 and rnn_rb rather than ?
Or because the lenght is varient it is not possible?

Thanks again.

@sbillburg
Copy link
Owner

Can you please let me know about this?
here rnn2_merged = concatenate([rnn_2, rnn_2b])
the dimension of rnn_2 = (?, ?, 128)
and rnn_2b= (?, ?, 128)
is there anyway we can give the actual size to rnn_2 and rnn_rb rather than ?
Or because the lenght is varient it is not possible?

Thanks again.

You cannot set the specific dimension of rnn_2, two "? " depend on input dataset at the very beginning, First'?' presents the batch size, and the second is 1/8 of input image width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants