What is a fully connected layer?
A fully connected layer is a neural network layer in which every neuron receives input from every neuron in the previous layer.
It is also called a dense layer or linear layer in many deep learning libraries.
How it works
Each output neuron computes a weighted combination of all input values, adds a bias, and may then pass the result through an activation function.
A simplified form is:
z = Wx + b
where:
xis the input vector.Wcontains the learned weights.bcontains the learned biases.zis the layer output before an optional activation function.
Because every input contributes to every output neuron, a fully connected layer can combine information from all features at once.
Where are fully connected layers used?
They are commonly used:
- In multilayer perceptrons.
- Near the end of CNNs to convert extracted features into predictions.
- As projection layers inside many neural network architectures.
- In classification and regression output heads.
Why are they called fully connected?
If a previous layer has 100 outputs and the fully connected layer has 20 neurons, each of those 20 neurons receives all 100 input values.
That means the layer contains:
100 × 20 = 2,000 weights
plus 20 bias values.
Main limitation
Fully connected layers can require many parameters when the input is large. This is one reason CNNs use convolutional layers for images instead of connecting every pixel directly to every neuron.
For the basic components being learned, see “What are weights and biases in a neural network?”.
In short, a fully connected layer connects every input feature to every output neuron, allowing the network to combine information across the entire input representation.
Learning Sequence
Deep Learning Curriculum
Explore Related Questions
Deepen your understanding across related Deep Learning topics.