是否可以使用TimeSeriesGenerator拟合Keras、Tensorflow 2中具有两个输入的函数模型?
以下是一些代码的具体示例:是否可以使用TimeSeriesGenerator拟合Keras、Tensorflow 2中具有两个输入的函数模型?,keras,time-series,generator,lstm,tensorflow2.0,Keras,Time Series,Generator,Lstm,Tensorflow2.0,以下是一些代码的具体示例: input1 = Input(shape = (3,2)) x1 = LSTM(8)(input1) x1 = Flatten()(x1) x1 = Dense(10)(x1) input2 = Input(shape = (3,2)) x2 = LSTM(8)(input2) x2 = Flatten()(x2) x2 = Dense(10)(x2) x = concatenate([x1, x2]) y = Dense(1)(x) model = Mod
input1 = Input(shape = (3,2))
x1 = LSTM(8)(input1)
x1 = Flatten()(x1)
x1 = Dense(10)(x1)
input2 = Input(shape = (3,2))
x2 = LSTM(8)(input2)
x2 = Flatten()(x2)
x2 = Dense(10)(x2)
x = concatenate([x1, x2])
y = Dense(1)(x)
model = Model([input1, input2], y)
model.compile(optimizer='Adam',
loss='mean_squared_error')
是否可以使用Keras生成器将此模型与两个numpy阵列相匹配
例如
X1 = np.random.randn((100, 2))
X2 = np.random.randn((100, 2))