根据你那里的情况。
这就是我在keras会做的。我将假设您只想在将输入输入输入到模型中之前将其连接起来。
所以我们要用numpy来做。笔记
类似于:
import numpy as np
from keras.model import Dense, Model,Input
X = np.random.rand(100, 1)
Y = np.random.rand(100, 1)
y = np.random.rand(100, 16)
# concatenate along the features in numpy
XY = np.cancatenate(X, Y, axis=1)
# write model
in = Input(shape=(2, ))
out = Dense(16, activation='tanh')(in)
# print(out.shape) (?, 16)
model = Model(in, out)
model.compile(loss='mse', optimizer='adam')
model.fit(XY, y)
....