Какую размерность ожидает conv1d слой?

Имеются данные в 3 признака и таргет в виде 2 классов. Для анализа данных как временного ряда переформатировал признаки в обучающий набор, размер (400000, 10, 3) вопрос по Conv1D: не могу понять какую размерность он ожидает на входе. Выдает ошибку:

ValueError: Input 0 is incompatible with layer conv1d_1: expected ndim=3, found ndim=4

import numpy as np
import pandas as pd
from datetime import datetime
from keras.models import Sequential
from keras.layers import Dense,  LSTM, Conv1D, Dropout, Activation, Flatten, AveragePooling1D
from keras import regularizers
now = datetime.now()
full = np.loadtxt("mudel-2x.csv", delimiter=";")
y_train = full[:400000, 3]
y_test = full[400000:, 3]
x = full[:400000, 0:3]

x = pd.DataFrame(x)
x_train = np.array([])

for i in range(x.shape[0]):
    if i % 1000 ==0:
        print("i1 = ", i,"/", x.shape[0])
    temp_list = []
    for j in range(9, -1, -1):
        if i > 9:
            temp_tuple = (x.iloc[i-j, 0], x.iloc[i-j, 1], x.iloc[i-j, 2])
        else:
            temp_tuple = (0, 0, 0)
        temp_list.append(temp_tuple)
    temp_list = np.array(temp_list)
    x_train = np.append(x_train, temp_list)
x_train = x_train.reshape((-1, 10, 3))

x = full[400000:, 0:3]
x = pd.DataFrame(x)
x_test = np.array([])
for i in range(x.shape[0]):
    if i % 1000 == 0:
        print("i2 = ", i, "/", x.shape[0])
    temp_list = []
    for j in range(9, -1, -1):
        temp_tuple = (x.iloc[i-j, 0], x.iloc[i-j, 1], x.iloc[i-j, 2])
        temp_list.append(temp_tuple)
    temp_list = np.array(temp_list)
    x_test = np.append(x_test, temp_list)
x_test = x_test.reshape((-1, 10, 3))

print(datetime.now() - now)

b

batch_size = 500
model = Sequential()
model.add(Conv1D(16, 8, input_shape=(batch_size, 10, 3)))
model.add(Dropout(0.3))
model.add(Dense(64))
model.add(Dropout(0.2))
model.add(Dense(16))
model.add(Dense(1, activation='sigmoid'))

model.compile(loss='binary_crossentropy',
              optimizer='adam',
              metrics=['accuracy'])

model.fit(x_train, y_train,
          batch_size=batch_size,
          epochs=10,
          validation_data=(x_test, y_test))

score, acc = model.evaluate(x_test, y_test, batch_size=batch_size)
print(score, acc)

Ответы (0 шт):