liveBook · Manning

Functional API

As explained in Deep Learning with Python, Third Edition

The Keras model-building interface that expresses a model as a directed acyclic graph of layers with explicit connectivity.

The Functional API builds Keras models as graphs of layers with explicit connectivity. It fits models with multiple inputs, multiple outputs, or other nonlinear topologies. section 7.2 section 7.2.2

It starts with symbolic Input tensors, applies layers to those tensors, and finishes by constructing a Model from the chosen inputs and outputs. That makes layer connectivity directly inspectable and reusable. section 7.2.2 section 7.2.5

Common uses here include:

  • Building a simple two-layer model with Input, Dense, and Model. section 7.2.2
  • Combining several inputs and branching to several outputs for ticket ranking and routing. section 7.2.2
  • Plotting models and reusing intermediate layer outputs. section 7.2.2 section 7.2.5

Multi-input ticket classifier

Three inputs—title, text body, and tags—are concatenated, passed through a Dense feature layer, then split into priority and department outputs. The same model is trained and evaluated with either lists or dicts of arrays. section 7.2.2 section 7.2.2

Figure 7.1 Progressive disclosure of complexity for model building
progressive disclosure of complexity models

Shows the progression from simple stacks to graph-like model building. section 7.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Explains symbolic inputs, layer chaining, model construction, multi-input/output wiring, plotting, and intermediate output reuse.
Examples
Uses a two-layer stack, a customer-support ticket classifier, and reused intermediate features for a new output.
What it assumes
Assumes familiarity with Sequential and basic Keras training APIs, while introducing symbolic tensors and explicit graph wiring from zero.
What you can do after
Builds graph-structured Keras models, train them with list or dict inputs and targets, and inspect or reuse layer connectivity.
How it connects
Connects with Sequential, model subclassing, Layer, Model, compile, fit, evaluate, predict, and plot_model.

Also explained in

Compare how 3 books explain Functional API →

Related concepts

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