inspecting and monitoring deep-learning models using keras callbacks and tensorboard in this sectionwe'll review ways to gain greater access to and control over what goes on inside your model during training launching training run on large dataset for tens of epochs using model fit(or model fit_generator(can be bit like launching paper airplanepast the initial impulseyou don' have any control over its trajectory or its landing spot if you want to avoid bad outcomes (and thus wasted paper airplanes)it' smarter to use not paper planebut drone that can sense its environmentsend data back to its operatorand automatically make steering decisions based on its current state the techniques we present here will transform the call to model fit(from paper airplane into smartautonomous drone that can selfintrospect and dynamically take action using callbacks to act on model during training when you're training modelthere are many things you can' predict from the start in particularyou can' tell how many epochs will be needed to get to an optimal validation loss the examples so far have adopted the strategy of training for enough epochs that you begin overfittingusing the first run to figure out the proper number of epochs to train forand then finally launching new training run from scratch using this optimal number of coursethis approach is wasteful much better way to handle this is to stop training when you measure that the validation loss in no longer improving this can be achieved using keras callback callback is an object ( class instance implementing specific methodsthat is passed to the model in the call to fit and that is called by the model at various points during training it has access to all the available data about the state of the model and its performanceand it can take actioninterrupt trainingsave modelload different weight setor otherwise alter the state of the model here are some examples of ways you can use callbacksmodel checkpointing--saving the current weights of the model at different points during training early stopping--interrupting training when the validation loss is no longer improving (and of coursesaving the best model obtained during trainingdynamically adjusting the value of certain parameters during training--such as the learning rate of the optimizer logging training and validation metrics during trainingor visualizing the representations learned by the model as they're updated--the keras progress bar that you're familiar with is callbackthe keras callbacks module includes number of built-in callbacks (this is not an exhaustive list)keras callbacks modelcheckpoint keras callbacks earlystopping licensed to