【发布时间】:2023-12-22 13:19:01
【问题描述】:
我正在尝试 Keras,但我坚持做以下事情。我有一个包含特征数组的列表,我需要将它与 Keras 进行卷积。特征数组列表由以下代码生成。
features= []
for i in range(32): # Contains 32 feature arrays
x = np.random.randint(low=-1, high=1, size=16) #Each feature arraysize = 16
features.append(x)
我尝试的卷积步骤如下,
conv = Sequential()
conv.add(Convolution1D(filters=32, kernel_size=3, input_shape=(16,1),
activation='elu', use_bias=True))
conv.add(Dense(units=1))
conv.compile(optimizer='adam', loss='mse')
#conv.predict(features) is the way I tried but failed.
我需要获取输入特征列表的卷积列表。我该怎么做?
【问题讨论】:
-
请发布错误
-
为什么卷积特征随机初始化权重?
-
特征列表包含地理坐标序列的空间特征(以上特征列表为示例)。我需要通过卷积来捕获序列中的空间依赖关系。
-
predict() 遇到什么问题
-
ValueError: Error when checking model : the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 1 array(s), but instead got the following list of 32 arrays并且 model.predict() 不返回卷积矩阵
标签: deep-learning keras sequence convolution