我正在使用向量序列作为tensorflow中NN的输入数据,我希望在输入深度上执行平均池
我尝试使用以下lambda层:
depth_pool = keras.layers.Lambda(
lambda X: tf.nn.avg_pool1d(X,
ksize=(1, 1, 3),
strides=(1, 1, 3),
padding="VALID"))
但是,我收到了错误消息:
UnimplementedError: Non-spatial pooling is not yet supported.
有没有办法达到预期的效果
非常感谢你的帮助
如果您的输入具有以下维度:
(None, timestamps, features)
您可以简单地用其他维度置换深度,应用标准池,然后置换回原始维度举个例子。。。如果您的网络接受shape
(None, 20, 99)
的输入,您只需执行以下操作即可获得深度池:摘要:
输出具有形状
(None, 20, 33)
如果您的输入具有以下维度:
(None, features, timestamps)
,您只需在层中设置data_format='channels_first'
摘要:
输出具有形状
(None, 20, 33)
相关问题 更多 >
编程相关推荐