Skip to content

Commit

Permalink
Update 03-build-cnn.md
Browse files Browse the repository at this point in the history
Updated explanation of flatten with spoiler drop down
  • Loading branch information
isaac-jennings authored Mar 26, 2024
1 parent e5d0a73 commit a7fafc2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions episodes/03-build-cnn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a7fafc2

Please sign in to comment.