C3_W3_Exercise01 Question

I have a question about exercise 1 in Course 3, is that why we need to add the layer AveragePooling1D? and when we add this layer, is this affect our final prediction?

Hi @oab224

We usually add AveragePooling or MaxPooling layers in CNNs to reduce the dimensionality of the input and extract more features.

  • AveragePooling → beneficial for reducing noise and improving generalization.

  • MaxPooling → effective in highlighting key patterns and structures in the data.

They help us manage computational complexity and improve generalization by focusing on dominant features and reducing overfitting. However, excessive use may lead to information loss, potentially affecting accuracy.

Thank you…, but I want to ask more about this layer. is that use averagePooling after LSTM layer will have reduce noise (suppose we have embedding layer before LSTM) and how that work??

This layer can help reduce noise by averaging the outputs over a temporal window, smoothing out fluctuations and focusing on more stable patterns.

This layer becomes useful if your LSTM outputs are noisy or if you want to highlight overall trends rather than specific peaks. The AveragePooling layer calculates the average value within each window, reducing the influence of any outliers or noise, that helps enhance the model’s ability to generalize from the learned features.

Hope this helps, feel free to ask if you need further assistance!