以下のコードで実行したところエラーが出ました。配列の次元がおかしいと言われている気がしますがどこがおかしいのか分かりません。
よければお知恵をお貸しください。
ちなみにlastpriceは60個のfloat型の数値の入った配列でそれを10刻みでXtrainとy_trainに分けました。
max_min関数はmax_min法によるデータの正規化です。
python3
1in_out_neurons = 1 2hidden_neurons = 300 3length_of_sequences = 10 4 5model = Sequential() 6model.add(LSTM(hidden_neurons, batch_input_shape=(None, length_of_sequences, in_out_neurons), return_sequences=False)) 7#model.add(Flatten()) 8model.add(Dense(in_out_neurons)) 9model.add(Activation("linear")) 10model.compile(loss="mean_squared_error", optimizer="adam",) 11early_stopping = EarlyStopping(monitor='val_loss', mode='auto', patience=0) 12#データの整形 13last=np.array(last_price) 14last=min_max(last) 15X_train, y_train = _load_data(last) 16 17 #予測開始 18history = model.fit(X_train, y_train, batch_size=600, epochs=10, validation_split=0.1, callbacks=[early_stopping])
ValueError: Error when checking input: expected lstm_8_input to have 3 dimensions, but got array with shape (50, 10)
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。