tf.keras.callbacks.History

Callback that records events into a History object.

Inherits From: Callback

This callback is automatically applied to every Keras model. The History object gets returned by the fit method of models.

Example:

model = tf.keras.models.Sequential([tf.keras.layers.Dense(10)])
model.compile(tf.keras.optimizers.SGD(), loss='mse')
history = model.fit(np.arange(100).reshape(5, 20), np.zeros(5),
                    epochs=10, verbose=1)
print(history.params)
{'verbose': 1, 'epochs': 10, 'steps': 1}
# check the keys of history object
print(history.history.keys())
dict_keys(['loss'])

Methods

set_model

View source

set_params

View source