【发布时间】:2020-03-12 22:21:44
【问题描述】:
我有一个 Keras 模型,尺寸如下:
________________________________________________________________________________
Layer (type) Output Shape Param #
================================================================================
stft (InputLayer) (None, 1, 16384) 0
________________________________________________________________________________
static_stft (Spectrogram) (None, 1, 65, 256) 16640
________________________________________________________________________________
conv2d_1 (Conv2D) (None, 38, 5, 9) 12882
________________________________________________________________________________
dense_1 (Dense) (None, 38, 5, 512) 5120
________________________________________________________________________________
predictions (Dense) (None, 38, 5, 368) 188784
================================================================================
我对最后密集层的维度感到困惑。我希望分别拥有 (None,512) 和 (None,368)。这是由以下答案建议的:Keras lstm and dense layer
它们最终的密集层创建如下:
x = keras.layers.Dense(512)(x)
outputs = keras.layers.Dense(
368, activation='sigmoid', name='predictions')(x)
那么为什么他们有超过 512 个输出呢?我该如何改变呢?
【问题讨论】:
标签: python tensorflow keras