liveBook · Manning

Neural network layer

As explained in Math and Architectures of Deep Learning

A stage in a neural network that transforms one set of activations into another.

A neural network layer is a stage of perceptrons that receives activations from the immediately preceding layer and produces a new set of activations. Connections run only between successive layers, making forward evaluation and training more manageable. Multiple layers can represent complicated functions with fewer perceptrons because each layer adds nonlinearity and expressive power. section 8.2 section 8.6

For layer l, the outputs of layer l−1 form the input activation vector a^(l−1). A linear layer combines these activations with a weight matrix W^(l) and biases, producing each neuron's weighted sum; applying an activation function such as sigmoid gives a^(l) = σ(W^(l)a^(l−1) + b^(l)). Matrix-vector notation expresses all neurons together instead of writing separate sums. section 8.3.1 section 8.6

A layered network therefore provides:

  • A structured transformation from input space toward output space. section 1.8
  • Additional nonlinear transformations that help model functions such as XOR and other complicated relationships. section 8.2
  • Parameters—weights and biases—that training adjusts to reduce loss. section 8.6

From one layer to the next

If layer l−1 has m activations and layer l has n neurons, W^(l) is an n×m matrix. Each row collects the weights feeding one neuron; matrix multiplication computes all n weighted sums at once, after which sigmoid can be applied element by element. section 8.3.1

Figure 8.6 Linear layer outputting layer l from layer (l − 1). The weights belonging to row 1 of the weight matrix (coming from all the input neurons, layer (l − 1), which sum together to form output neuron 1) are shown in bold.

Use the figure to trace how one row of the weight matrix gathers activations from layer l−1 to produce a neuron in layer l. section 8.3.1

How Math and Architectures of Deep Learning covers it

How deep it goes
Explains connectivity, nonlinear motivation, and matrix-vector computation, but stops short of detailed gradient derivations.
Examples
Uses XOR, sigmoid transformations, weight matrices, and a diagram tracing one layer's inputs to its output neurons.
What it assumes
Assumes familiarity with perceptrons and weighted inputs while treating activations, layers, and matrix notation in context.
What you can do after
Evaluate how a layer transforms activations and interpret its weight matrix within a multilayer network.
How it connects
Connects layers to perceptrons, activations, matrix multiplication, multilayer perceptrons, forward propagation, and loss minimization.

Also explained in

Compare how 7 books explain neural network layer →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.