Input Layer
The input layer is the first layer of a neural network that receives data.
Each neuron in this layer is responsible for a specific part of the input data, and this information is passed on to the next layer of the network (the hidden layer).
For instance, when processing a 5×5
grayscale image, the brightness value of each pixel is received by the input layer and sent to individual neurons.
The example below demonstrates how a 5×5
image is delivered to the neurons in the input layer.
Example of pixel values entering the input layer
[
[0, 0, 255, 0, 0],
[0, 255, 0, 255, 0],
[255, 0, 0, 0, 255],
[0, 255, 0, 255, 0],
[0, 0, 255, 0, 0]
]
Here, 0
represents black, and 255
represents white.
In neural networks, it is common to normalize the data between the values of 0 and 1 to facilitate easier learning.
For example, converting 255 to 1.0
and 0 to 0.0
is a commonly used approach.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.