我正在将(822222,2)的2D数组输入此模型:
regressor = Sequential()
regressor.add (LSTM (2, activation = 'sigmoid', dropout = .1))
regressor.add (Dense (2, activation = 'tanh'))
regressor.compile (optimizer = 'rmsprop', loss = 'mean_squared_error')
regressor.fit (x = document, y = document, batch_size = 32, epochs = 1000)
但是这会在最后一行返回错误,仅接受带有ndim = 3
的数组:
Input 0 is incompatible with layer lstm_34: expected ndim=3, found ndim=2
我尝试重塑,但是我提供的大多数配置都使数据无法使用。是什么让模型接受我的输入?