Hi.
I'm trying to build a model, reusing two pre-trained models as parts of it.
Let us suppose that my component model has the following configuration:
model1 = keras.models.Sequential([
keras.layers.Dense(400, input_shape=(2,bits), activation="relu"),
keras.layers.Dropout(0.2),
keras.layers.Flatten(),
keras.layers.Dense(400, activation="relu"),
keras.layers.Dropout(0.2),
keras.layers.Dense(2, activation="softmax")
])
I would like to train two models with this configuration. Let's say, I would have the model1 and model2 at the end of this step.
My idea is to frozen the the layers of these models.
After that, I would like to merge (with a keras.layers.concatenate layer) the outputs of these two models and connect this concatenation to an output layer (keras.layers.Dense(2, activation="softmax")).
As a final step, I would like to train the resulting model (called ensamble_model).
How can I do that?
Best regards.