diff --git a/episodes/03-build-cnn.md b/episodes/03-build-cnn.md index 9c197e75..6df21406 100644 --- a/episodes/03-build-cnn.md +++ b/episodes/03-build-cnn.md @@ -300,6 +300,18 @@ The next type of hidden layer used in our introductory model is a type of reshap The **Flatten** layer converts the output of the previous layer into a single one-dimensional vector that can be used as input for a dense layer. +::::::::::::::::::::::::::::::::::::::::: spoiler + +#### What does **Flatten** mean exactly? + +A flatten layer function is typically used to transform the two-dimensional arrays (matrices) generated by the convolutional and pooling layers into a one-dimensional array. This is necessary when transitioning from the convolutional/pooling layers to the fully connected layers, which require one-dimensional input. + +During the convolutional and pooling operations, a neural network extracts features from the input images, resulting in multiple feature maps, each represented by a matrix. These feature maps capture different aspects of the input image, such as edges, textures, or patterns. However, to feed these features into a fully connected layer for classification or regression tasks, they must be a single vector. + +The flatten layer takes each element from the feature maps and arranges them into a single long vector, concatenating them along a single dimension. This transformation preserves the spatial relationships between the features in the original image while providing a suitable format for the fully connected layers to process. + +::::::::::::::::::::::::::::::::::::::::: + #### CNN Part 3. Output Layer