How do I create a variable-length input LSTM in Keras?

I am not clear about the embedding procedure. But still here is a way to implement a variable-length input LSTM. Just do not specify the timespan dimension when building LSTM. import keras.backend as K from keras.layers import LSTM, Input I = Input(shape=(None, 200)) # unknown timespan, fixed feature size lstm = LSTM(20) f = K.function(inputs=[I], … Read more

Why aren’t variable-length arrays part of the C++ standard?

[*] (Background: I have some experience implementing C and C++ compilers.) Variable-length arrays in C99 were basically a misstep. In order to support VLAs, C99 had to make the following concessions to common sense: sizeof x is no longer always a compile-time constant; the compiler must sometimes generate code to evaluate a sizeof-expression at runtime. … Read more