I have 8 Keras models, the outputs from which I use to feed the final model.
Each model is a variation of the following:
model1 = Sequential()
model1.add(Dense(units = 32, kernel_initializer='glorot_normal', activation = 'relu', input_shape=(shape1,)))
model1.add(Dense(units = 32, kernel_initializer='glorot_normal', activation = 'relu'))
model1.add(Dense(units = 1, kernel_initializer='glorot_normal', activation = 'relu'))
model1.compile(optimizer = 'adam', loss='mean_absolute_error', metrics=['mse', 'mae', 'mape'])
model1.fit(X1, y, batch_size = 512, epochs=20)
X1_predictions = model1.predict(X1)
I train all 8 models separately, output predictions and then append in numpy...
X_final = np.append(np.append(X1_predictions, X2_predictions, axis=1), ..., X8_predictions, axis=1)
Then input X_final into a model.
Is there a more sane way to do this by horizontally stacking the 8 separate models into a single model? (i.e., where I wouldn't compile/fit/predict each individual model, but do it all in one?