我试图了解喀拉拉语中的model.summary()
,我的代码为:
model = Sequential([
Dense(3,activation='relu',input_shape=(6,)),
Dense(3,activation='relu'),
Dense(1),
])
model.compile(optimizer='adam',
loss='mean_squared_error',
metrics=['mae','mape','mse','cosine']
)
当我print(model.summary())
时,输出为
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
dense_16 (Dense) (None, 3) 21
_________________________________________________________________
dense_17 (Dense) (None, 3) 12
_________________________________________________________________
dense_18 (Dense) (None, 1) 4
=================================================================
Total params: 37
Trainable params: 37
Non-trainable params: 0
_________________________________________________________________
None
相对于我所描述的模型输入层,我无法理解density_16,densage_17和density_18的含义。
答案 0 :(得分:1)
这些只是您图层的名称。如果您未明确指定图层名称,它们将被自动命名并编号。
答案 1 :(得分:1)
这些只是Keras自动生成的图层的名称。要手动命名图层,请将关键字参数name='my_custon_name'
传递到要命名的每个图层。请注意,图层名称在模型中必须唯一。
图层名称对于调试和获取代码中的特定图层非常有用,例如使用model.get_layer(layer_name)
。