我使用下面的代码使用 keras 构建了一个 MLP。
model_relu = Sequential()
model_relu.add(Dense(256, activation='relu', input_shape=(input_dim,), kernel_initializer=RandomNormal(mean=0.0, stddev=0.062, seed=None)))
model_relu.add(Dense(128, activation='relu', kernel_initializer = RandomNormal(mean=0.0, stddev=0.125, seed=None)) )
model_relu.add(Dense(64, activation='relu', kernel_initializer = RandomNormal(mean=0.0, stddev=0.07, seed=None)) )
model_relu.add(Dense(output_dim, activation='softmax'))
model_relu.summary()
总结是
Model: "sequential_19"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
dense_49 (Dense) (None, 256) 200960
_________________________________________________________________
dense_50 (Dense) (None, 128) 32896
_________________________________________________________________
dense_51 (Dense) (None, 64) 8256
_________________________________________________________________
dense_52 (Dense) (None, 10) 650
我想知道这个 MLP 有多少隐藏层。我们应该将 3 称为此隐藏层的数量还是 4 个隐藏层。总层数是 5(输入 + 3 隐藏 + 1 输出(softmax)?