lstm

Keras Lstm predicting next item, taking whole sequences or sliding window. Will sliding window need stateful LSTM?

半城伤御伤魂 提交于 2020-12-13 03:27:07
问题 I have a sequence prediction problem in which, given the last n items in a sequence I need to predict next item. I have more than 2 million sequences each with different timesteps ( length of sequence ), like some are just 5 and some are 50/60/100/200 upto 500. seq_inputs = [ ["AA1", "BB3", "CC4",…,"DD5"], #length/timeteps 5 ["FF1", "DD3", "FF6","KK8","AA5", "CC8",…, "AA2"] #length/timeteps 50 ["AA2", "CC8", "CC11","DD3", "FF6","AA1", "BB3",……,”DD11”]#length/timesteps 200 .. .. ] # there are

Keras Lstm predicting next item, taking whole sequences or sliding window. Will sliding window need stateful LSTM?

限于喜欢 提交于 2020-12-13 03:24:24
问题 I have a sequence prediction problem in which, given the last n items in a sequence I need to predict next item. I have more than 2 million sequences each with different timesteps ( length of sequence ), like some are just 5 and some are 50/60/100/200 upto 500. seq_inputs = [ ["AA1", "BB3", "CC4",…,"DD5"], #length/timeteps 5 ["FF1", "DD3", "FF6","KK8","AA5", "CC8",…, "AA2"] #length/timeteps 50 ["AA2", "CC8", "CC11","DD3", "FF6","AA1", "BB3",……,”DD11”]#length/timesteps 200 .. .. ] # there are

Keras attention layer over LSTM

旧街凉风 提交于 2020-11-30 06:47:25
问题 I'm using keras 1.0.1 I'm trying to add an attention layer on top of an LSTM. This is what I have so far, but it doesn't work. input_ = Input(shape=(input_length, input_dim)) lstm = GRU(self.HID_DIM, input_dim=input_dim, input_length = input_length, return_sequences=True)(input_) att = TimeDistributed(Dense(1)(lstm)) att = Reshape((-1, input_length))(att) att = Activation(activation="softmax")(att) att = RepeatVector(self.HID_DIM)(att) merge = Merge([att, lstm], "mul") hid = Merge("sum")

Python can't apply fit_generator to keras model with multiple input

狂风中的少年 提交于 2020-11-29 10:35:12
问题 I have the following model - this is LSTM + CNN with 3 inputs. And I built this generator function to train the model using fit_generator (based on this: https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly): class MultiInputDataGenerator(keras.utils.Sequence): 'Generates data for Keras' def __init__(self, list_IDs, labels, shuffle=True): 'Initialization' self.batch_size = 8 self.labels = labels self.list_IDs = list_IDs self.n_classes = 5 self.shuffle = shuffle self.on

Python can't apply fit_generator to keras model with multiple input

喜你入骨 提交于 2020-11-29 10:34:10
问题 I have the following model - this is LSTM + CNN with 3 inputs. And I built this generator function to train the model using fit_generator (based on this: https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly): class MultiInputDataGenerator(keras.utils.Sequence): 'Generates data for Keras' def __init__(self, list_IDs, labels, shuffle=True): 'Initialization' self.batch_size = 8 self.labels = labels self.list_IDs = list_IDs self.n_classes = 5 self.shuffle = shuffle self.on

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching distribution found for tensorflow)

强颜欢笑 提交于 2020-11-29 07:34:02
问题 I want to install tensorflow to use Keras LSTM I installed Keras, and i import this lines to my code. from keras.callbacks import LambdaCallback from keras.models import Sequential from keras.layers import Dense, Activation from keras.layers import LSTM from keras.optimizers import RMSprop Error is when runnig the code: No module named 'tensorflow' Cmd error when i write "pip install tensorflow" : ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)