How to handle variable length data for LSTM
问题 From what I know the general steps to preprocess data for LSTM include the following steps vocab_size = 20000 # Only consider the top 20k words maxlen = 200 # Only consider the first 200 words of each movie review (x_train, y_train), (x_val, y_val) = keras.datasets.imdb.load_data(num_words=vocab_size) print(len(x_train), "Training sequences") print(len(x_val), "Validation sequences") x_train0 = keras.preprocessing.sequence.pad_sequences(x_train, maxlen=maxlen) x_val0 = keras.preprocessing