I have to inputs that I want to merge into one network, so it should be something like:
input1 input2
| |
| |
hidden hidden
Merged
I tried this code:
b1_part = Sequential()
b1_part.add(Dense(units=b1_X_train.shape[1],activation='tanh', activity_regularizer=regularizers.l2(1e-2)))
b1_part.add(Dropout(0.5))
b1_part.add(Dense(units=b1_X_train.shape[1]/4,activation='tanh', activity_regularizer=regularizers.l2(1e-2)))
b2_part = Sequential()
b2_part.add(Dense(units=b2_X_train.shape[1],activation='tanh', activity_regularizer=regularizers.l2(1e-2)))
b2_part.add(Dropout(0.5))
b2_part.add(Dense(units=b2_X_train.shape[1]/4,activation='tanh', activity_regularizer=regularizers.l2(1e-2)))
result = Concatenate(axis=1)([b1_part, b2_part])
optimizer = Adagrad()
result.compile(optimizer=optimzier, loss=BinaryFocalLoss(gamma=2),
metrics=['accuracy'])
But got:
ValueError: Layer concatenate_10 was called with an input that isn't a symbolic tensor. Received type: <class 'tensorflow.python.keras.engine.sequential.Sequential'>. Full input: [<tensorflow.python.keras.engine.sequential.Sequential object at 0x7fb1cbf97048>, <tensorflow.python.keras.engine.sequential.Sequential object at 0x7fb1cbeb5358>]. All inputs to the layer should be tensors.
Any idea why?