Chapter 8: Callbacks

We will now discuss Callbacks. If you have worked with Tensorflow, you must have used callbacks for various reasons. These callbacks are also quite similar to that. But before we start, let’s understand:

8.1 What are Callbacks?

A callback can be taken as an event that is integrated with a function and is triggered at different execution points within the function. For example: consider writing logs after every epoch of training a model. In this case,

  1. Callback: Writing logs.
  2. Event: Every epoch.
  3. Function: Model training.

 

Some major use cases of callbacks can be:

 

  1. Asynchronous Operations: Callbacks are commonly used in asynchronous programming to handle tasks like reading files, making network requests, or processing ...

Get LangChain in your Pocket now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.