Fully Connected Layer (Linear Layer, Dense Layer)
Definition
Let’s refer to as a layer. Consider as the matrix representation of . When consists only of components that are not , is called a fully connected layer.
Explanation
A fully connected layer is the most fundamental layer in an artificial neural network. In deep learning, most layers are linear; however, the term linear layer often refers to a fully connected layer. The term dense layer is also commonly used.
It is called fully connected because each component of the function’s value depends on all variables and is often represented by diagrams like the following:
Specifically, a fully connected layer is a function described as follows:
In practice, when constructing a neural network, a bias is added, transforming it into an affine transformation as follows:
Of course, even in this case, if we let and , we can still recognize it as a linear transformation as follows:
The essence of machine learning and deep learning is to accurately approximate the function we desire using the structure known as an artificial neural network. Early deep learning utilized functions composed of fully connected layers and activation functions several times (i.e., deeply), as approximators. This is known as a (multi-layer) perceptron. In contemporary practice, convolutional layers are predominantly used for image-related problems, but linear layers are still employed in the final layer for classification tasks.