liveBook · Manning

Composition

As explained in Deep Learning with PyTorch, Second Edition

The operation of applying one function to the output of another, used here to describe how layers are chained in a neural network.

Composition applies one function to another function’s output. In a multilayer neural network, each layer’s output becomes the next layer’s input. A weight matrix handles the whole layer at once, while the input is a vector. section 6.1.1

x_1 = f(w_1 * x + b_1)    #1
x_2 = f(w_2 * x_1 + b_2)    #2
...
o = f(w_h * x_n + b_h)    #3

Follow the sequence of layer calculations: each result feeds the next layer, until the network produces its output. section 6.1.1

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Defines composition through sequential layer outputs and notes that matrix weights calculate across a layer.
Examples
Uses equations that pass each layer’s calculated output into the following layer.
What you can do after
Understand how outputs from successive neural network layers combine to produce a final output.
How it connects
Links function composition to neural networks, layers, vectors, matrices, and linear algebra.

Also explained in

Compare how 11 books explain composition →

Related concepts

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