liveBook · Manning

Backend

As explained in Deep Learning with R, Third Edition

A backend engine is a software system that executes the numerical and machine-learning operations required by a higher-level framework.

A backend is the low-level engine beneath a high-level API such as Keras. It executes tensor operations, gradients, and other numerical work needed to build, train, and run models. section 3.2 section 3.6.1

Keras backends provide practical flexibility:

  • TensorFlow is the default backend in a fresh keras3 environment. section 3.6.1
  • JAX, TensorFlow, and PyTorch can be selected interchangeably after Keras code is written. section 3.6.1
  • Backends can target CPU, GPU, or TPU hardware and support deployment across platforms. section 3.6.1
  • NumPy supports prediction workflows but cannot train models because it does not provide gradients. section 3.2

Selecting a backend in R

Call use_backend() before working with Keras. For example, library(keras3); use_backend("jax") selects JAX and declares its Python dependencies automatically. The Keras R package also accepts KERAS_BACKEND values such as "jax-gpu"; use "torch" for the PyTorch backend. section 3.6.1

Figure 3.4 Keras and its backends. A backend is a low-level tensor computing platform; Keras is a high-level deep learning API.
figure

Use the architecture diagram to distinguish Keras as the high-level API from backends as low-level tensor-computing platforms. section 3.2

How Deep Learning with R, Third Edition covers it

How deep it goes
Defines backend responsibilities and switching, then gives R configuration paths; stops short of implementing tensor operations or gradient internals.
Examples
Uses JAX selection in R, CPU/GPU backend suffixes, and workflows split across debugging, training, and inference.
What it assumes
Assumes Keras usage and distinguishes high-level APIs from low-level tensor computation; teaches backend selection and dependency setup.
What you can do after
Operate/configure Keras by selecting a backend with use_backend() or KERAS_BACKEND before loading keras3.
How it connects
Connects Keras with TensorFlow, PyTorch, JAX, NumPy, tensors, gradients, models, training, and inference.

Also explained in

Compare how 5 books explain backend →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.