0

Is it possible to show output of a model after each x epochs?

    epochs = 500
    model.fit(
        X_train, y_train, 
        batch_size=16, epochs=epochs, 
        validation_data=(X_test, y_test)
    )

I get output like:

Epoch 1/1000
3285/3285 [==============================] - 2s 592us/step - loss: 0.7643 - val_loss: 0.8058
Epoch 2/1000
3285/3285 [==============================] - 2s 526us/step - loss: 0.7637 - val_loss: 0.8044
...

What I would like, is it have output as (every 10 epochs):

Epoch 1/1000
3285/3285 [==============================] - 2s 618us/step - loss: 0.7458 - val_loss: 0.8107
Epoch 10/1000
3285/3285 [==============================] - 2s 516us/step - loss: 0.7411 - val_loss: 0.8047
Epoch 20/1000
3285/3285 [==============================] - 2s 588us/step - loss: 0.7430 - val_loss: 0.8020

I think I'm supposed to use on_batch_begin in the callback, but not sure what goes inside it.

Thanks

K Split X
  • 3,405
  • 7
  • 24
  • 49
  • 1
    Does this answer your question? [Report Keras model evaluation metrics every 10 epochs?](https://stackoverflow.com/questions/50568409/report-keras-model-evaluation-metrics-every-10-epochs) – Djinn Nov 05 '21 at 22:41
  • Or [this](https://github.com/keras-team/keras/issues/2850) – AloneTogether Nov 06 '21 at 08:54

0 Answers0