I have two data. One is time series and the other contains features such as Sex, education, etc. and I want to concatenate output of LSTM model and a dense model. However, I got an error message (look at the end).
This is what the data looks like:
And this is the code:
# PAY_data net
input1 = Input(shape=(6,1))
pay = LSTM(10)(input1)
pay = Dense(10, activation='relu')(pay)
# DEMO_data net
input2 = Input(shape=(5,1))
demo = Dense(10, activation='relu')(input2)
demo = Dense(10, activation='relu')(demo)
merge = concatenate([pay, demo])
hidden1 = Dense(10, activation='relu')(merge)
output = Dense(1, activation='sigmoid')(merge)
model = Model(inputs=[input1, input2], outputs=output)
print(model.summary())
model.compile(loss='binary_crossentropy', optimizer='adam', metrics= ['accuracy'])
model.fit([PAY_data, DEMO_data], y,nb_epoch=20, batch_size=50, verbose=2, validation_split=0.2)
and this is the error I get: