Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keras callback execution order?

Tags:

keras

tf.keras

I'm trying to understand Keras callback execution order. Suppose we pass multiple callbacks to model.fit(), each has a on_epoch_end method. So the moment we reach the end of an epoch, in which order will the callback functions be executed? Does the main process spawn multiple child-process and assign one to each callback?

It'd nice if the documentations are more detailed.

like image 227
Hongtao Yang Avatar asked Jan 24 '26 15:01

Hongtao Yang


1 Answers

They should be called in the order you've added them. If you look at the implementation of CallbackList class which manage your callbacks, you will see it's iterating by order of appearance. For example here in on_epoch_end.

Also, this is how the class is used in training loop and it does not seems that a separate process is spawn.

like image 184
bachr Avatar answered Jan 26 '26 23:01

bachr