Keras callback execution order?

Viewed 1019

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.

2 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.

  1. They will be executed in the order they are specified in your callbacks list inside the model.fit()
  2. child process is not created by a parent to perform execution
Related