liveBook · Manning

Hidden layer

As explained in Inside Deep Learning: Math, Algorithms, Models

A network layer between input and output that transforms representations before later computation, here before attention is applied.

A hidden layer sits between input and output layers and transforms values before later computation. In a fully connected network, adding a matrix introduces a tunable hidden-layer size: the number of neurons or intermediate outputs. section 2.2.1

Each neuron receives connections from every value in the preceding layer. For example, nn.Linear(3, 4) maps three inputs to four hidden outputs, followed by nn.Linear(4, 1) for one prediction. Nonlinear activations between hidden layers let classification boundaries bend rather than remain linear. section 2.2.1 section 2.3.3

Two hidden layers in PyTorch

A compact classifier uses nn.Linear(2, 30), Tanh(), nn.Linear(30, 30), Tanh(), and nn.Linear(30, 2). Increasing the hidden layers improves confidence and produces a nonlinear separation between two classes. section 2.3.3

Figure 2.4 A simple feed-forward fully connected network with one input layer of d = 3 inputs, a hidden layers with n = 4 neurons, and one output in the output layer. Connections feed directly into the next layer only, and each node in one layer is connected to every neuron in the preceding layer.

Use the network diagram to inspect feed-forward connections, hidden neurons, and the transition from three inputs to one output. section 2.2.1

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Defines layer shape, weight indexing, PyTorch modules, and nonlinear examples across fully connected and convolutional networks.
Examples
Uses nn.Linear(3, 4), two 30-unit hidden layers, nonlinear class regions, and convolution-to-linear flattening.
What it assumes
Assumes input and output layers, matrix operations, and basic PyTorch modules while defining hidden-layer terminology directly.
What you can do after
Build it from scratch with nn.Linear, activation modules, and nn.Sequential, then inspect its learned classification regions.
How it connects
Connects fully connected networks, linear regression, nonlinear classification, convolutional layers, activation functions, and flattening.

Also explained in

Compare how 8 books explain hidden layer →

Related concepts

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