C.W.K.
Stream
Lesson 04 of 07 · published

Keras 3's Breakthrough

~10 min · origin

Level 0Keras Apprentice
0 XP0/97 lessons0/20 achievements
0/120 XP to next level120 XP to go0% complete

One API, three engines

One API, three backends: TensorFlow, PyTorch, and JAX (plus OpenVINO for inference-only). The latest stable version is Keras 3.11.3.

The breakthrough is the keras.ops namespace — a universal operation layer that implements the full NumPy API plus neural network-specific functions. When you write keras.ops.matmul(x, w), Keras dispatches the call to jax.numpy.matmul, tf.matmul, or torch.matmul depending on the active backend, producing numerically identical results.

What "backend-agnostic" buys you

  • Write your model once, train it on any framework
  • Save a model trained on JAX, load it in TensorFlow for deployment
  • Use PyTorch's ecosystem for research, then export for TF Serving in production
  • Every built-in Keras layer, metric, loss, and optimizer uses keras.ops internally — so they're all portable for free

That last point is the quiet one that matters most: portability isn't a feature you opt into, it's the default the whole library is built on. The Code block below is the layer that makes it true.

Code

keras.ops — the universal operation layer·python
# keras.ops — the universal operation layer
import keras

# These work identically on TF, PyTorch, or JAX:
x = keras.ops.matmul(a, b)
y = keras.ops.nn.softmax(logits)
z = keras.ops.image.resize(img, size=(224, 224))

External links

Exercise

Install Keras 3 + one backend (pip install keras tensorflow). Write a 5-line script that prints keras.config.backend() and creates keras.ops.zeros((3, 3)). Then set KERAS_BACKEND=torch (after pip install torch) and rerun.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.