This chapter covers:
- The different ways to create Keras models: the
Sequential
class, the Functional API, andModel
subclassing
- How to use the built-in Keras training & evaluation loops — including how to use custom metrics and custom losses
- Using Keras callbacks to further customize how training proceeds
- Using TensorBoard for monitoring your training & evaluation metrics over time
- How to write your own training & evaluation loops from scratch
You’re starting to have some amount of experience with Keras — you’re familiar with the Sequential
model, Dense
layers, and built-in APIs for training, evaluation, and inference — compile()
, fit()
, evaluate()
, and predict()
. You’ve even learned in chapter 3 how to inherit from the Layer
class to create custom layers, and how to use the TensorFlow GradientTape
to implement a step-by-step training loop.
In the coming chapters, we’ll dig into computer vision, timeseries forecasting, natural language processing, and generative deep learning. These complex applications will require much more than a Sequential
architecture and the default fit()
loop. So let’s first turn you into a Keras expert! In this chapter, you’ll get a complete overview of the key ways to work with Keras APIs: everything you’re going to need to handle the advanced deep learning use cases you’ll encounter next.