我使用功能 API 创建了一个具有三个不同输出层的模型,以测试不同的激活函数。问题是每个 epoch 的输出行太长。我只想看准确性而不是损失。
Epoch 1/5
1875/1875 - 4s - loss: 3.7070 - Sigmoid_loss: 1.1836 - Softmax_loss: 1.2291 - Softplus_loss: 1.2943 - Sigmoid_accuracy: 0.9021 - Softmax_accuracy: 0.9020 - Softplus_accuracy: 0.5787
我不希望.fit()
函数打印每一层的损失,只打印准确性。我搜索了所有 Google 和 Tensorflow 文档,但找不到如何去做。
如果你想要完整的代码,请评论这篇文章。我会立即发送。
这是模型的摘要:
Model: "model"
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
InputLayer (InputLayer) [(32, 784)] 0
__________________________________________________________________________________________________
FirstHidden (Dense) (32, 512) 401920 InputLayer[0][0]
__________________________________________________________________________________________________
SecondHidden (Dense) (32, 256) 131328 FirstHidden[0][0]
__________________________________________________________________________________________________
Sigmoid (Dense) (32, 10) 2570 SecondHidden[0][0]
__________________________________________________________________________________________________
Softmax (Dense) (32, 10) 2570 SecondHidden[0][0]
__________________________________________________________________________________________________
Softplus (Dense) (32, 10) 2570 SecondHidden[0][0]
==================================================================================================
Total params: 540,958
Trainable params: 540,958
Non-trainable params: 0
__________________________________________________________________________________________________
None
谢谢你,祝你有美好的一天。