from keras.utils.generic_utils import Progbar progbar = Progbar(target=100) for i in range(100): progbar.update(i+1)
from keras.utils.generic_utils import Progbar progbar = Progbar(target=100, metrics=['accuracy', 'loss']) for i in range(100): metrics = {'accuracy': i/100, 'loss': (100-i)/100} progbar.update(i+1, metrics=metrics)This code creates a Progbar object with a target of 100 steps and displays custom metrics during each update. In this example, the accuracy and loss were used as the custom metrics, but any other metric can be used as long as it is passed as a dictionary. This will display a progress bar with the percentage completed, the elapsed time, and the custom metrics for each iteration.