Keras, and choosing a framework

Keras puts a high-level API on top of the engines you've now opened up — since Keras 3, on JAX, TensorFlow or PyTorch. See what compile and fit do on each backend, compare one model in four frameworks, and learn to choose by what each one actually is.

40 min

After this lesson you can

  • Build the same model with Keras's Sequential, Functional and subclassing APIs
  • Explain what compile() and fit() do on the JAX, PyTorch and TensorFlow backends
  • Map any training loop onto the four shared stages — arrays, graph, gradients, update
  • Compare NumPy, SciPy, PyTorch, JAX and Keras by execution model, autodiff and compilation, and choose between them for a task

In this lesson

  1. Keras: an API, not an engine
  2. Keras 3: one API, several backends
  3. What compile() and fit() actually do
  4. The five libraries side by side
  5. Choosing

This lesson is part of Descent Pro

Descent Pro unlocks every lesson on the route, from base camp to the summit. Every plan starts with a free trial.

Descent Pro

Start your free trial to keep reading

This lesson, and every other lesson on the route, is part of Descent Pro. Every plan starts with a free trial, and students with a .edu email get longer. Cancel before the trial ends and you pay nothing.