у меня следующая проблема.При реализации следующего кода
def model(inp_size):
inp = Input(shape=(inp_size, 1))
x1 = Dense(50, activation='elu')(inp)
x1 = Dense(20, activation='elu')(x1)
x1 = Dense(1, activation = 'linear')(x1)
x2 = Dense(50, activation='elu')(inp)
x2 = Dense(20, activation='elu')(x2)
x2 = Dense(1, activation = 'linear')(x2)
x3 = Dense(50, activation='elu')(inp)
x3 = Dense(20, activation='elu')(x3)
x3 = Dense(1, activation = 'linear')(x3)
x4 = Dense(50, activation='elu')(inp)
x4 = Dense(20, activation='elu')(x4)
x4 = Dense(1, activation = 'linear')(x4)
x1 = Lambda(lambda x: x * 3)(x1)
x2 = Lambda(lambda x: x * 2)(x2)
x3 = Lambda(lambda x: x * 2)(x3)
x4 = Lambda(lambda x: x * 1)(x4)
out = Add()([x1, x2, x3, x4])
return Model(inputs = inp, outputs = out)
X_train = np.random.rand(1000,12)
y_train =np.random.rand(1000,1)
NN_model = model(X_train.shape[1])
NN_model.compile(loss='mean_absolute_error', optimizer='Adamax', metrics=['mean_absolute_error'])
#N_model.summary()
NN_model.fit(X_train, y_train, epochs=10,verbose = 1)
predictions = NN_model.predict(X_test)
print('NN MAE = ', MAE)
я получаю ошибку
ValueError: Error when checking input: expected input_34 to have 3 dimensions, but got array with shape (1000, 12)
, которую я не получаю, так как я думал, что определил входной слой как inp = Input (shape = (inp_size,1)) это должно быть 1000, 1 для каждого набора данных
Извините, если это очень наивный вопрос, я все еще новичок. Спасибо!