Create a callback class which can be called during the optimizing process like `tf.keras.callbacks.Callback`.