0

I want to modify the display information of verbose in Keras. This is the original version:

model.fit(train, train_label,
          batch_size=32,
          epochs=100,
          verbose=1,
          validation_data=(test, test_label))

Epoch 1/2
104/104 [==============================] - 72s 456us/step - loss: 0.2823 - acc: 
0.8511 - val_loss: 0.2933 - val_acc: 0.8629

But others look like this:

234/10000 [====>.........................] - ETA: 81s - loss: 20.7154 - x1_loss: 9.5913 - x2_loss: 10.0536 - x3_loss: 1.0705

How can I show my loss value like him? (i.e. show x1_loss, x2_loss, x3_loss)

vincentlai
  • 379
  • 5
  • 18
  • The "others" are using multiple outputs, that's where there are multiple losses, does your model have multiple ouput? Because if not, then it would make no sense to have such display. – Dr. Snoopy Mar 25 '20 at 16:24
  • @MatiasValdenegro My model have multiple output. I need to modify the display of verbose. – vincentlai Mar 27 '20 at 00:32
  • Please include code that reproduces the problem, including the model itself. – Dr. Snoopy Mar 27 '20 at 09:48

1 Answers1

0

Changing the value of the verbosity parameter in the fit method changes how much information is displayed.

This answer has more info: What is the use of verbose in Keras while validating the model?

To change which loss values appear, i.e. x1_loss etc, you must use custom loss functions. In the keras.compile() step you get to select which loss function to use. The verbosity feature automatically displays whichever values are relevant, based on your chosen loss function.

See the documentation for more info. https://keras.io/losses/

Alan
  • 1,746
  • 7
  • 21