Skip to content

Conversation

@debug-soham
Copy link
Contributor

Summary

Closes: #108 This PR introduces MaxPooling2D and AveragePooling2D layers to the PyDeepFlow library. This is a crucial enhancement for building effective Convolutional Neural Networks (CNNs), allowing for the down-sampling of feature maps to reduce computational complexity and control overfitting.

Additionally, this PR includes fixes for the Multi_Layer_CNN constructor and the introspection module, ensuring that the model.summary() feature works correctly for both ANN and CNN models and that the entire test suite passes.

Changes Included

  • New Layers: Implemented MaxPooling2D and AveragePooling2D classes in pydeepflow/model.py with correct forward and backward passes.
  • CNN Constructor Fix: Corrected the Multi_Layer_CNN constructor in pydeepflow/model.py by removing the unused activations parameter, resolving a major conflict with the test suite.
  • Introspection Fix: Overhauled the ANNIntrospector and CNNIntrospector classes in pydeepflow/introspection.py to correctly identify all layer types and their properties, ensuring model.summary() is accurate.
  • Test Suite Updates:
    • Added tests/test_layers.py with unit tests for the new pooling layers.
    • Corrected calls in tests/test_model_summary.py to align with the updated Multi_Layer_CNN constructor.
  • Validator Update: Updated pydeepflow/validation.py to recognize 'maxpool' and 'avgpool' as valid layer types.

Verification

All 200+ tests in the suite, including the new tests for pooling layers, now pass successfully.

Copy link
Owner

@ravin-d-27 ravin-d-27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @debug-soham . Good work, thank you!

@ravin-d-27 ravin-d-27 merged commit 2e04854 into ravin-d-27:main Oct 15, 2025
1 check passed
@debug-soham debug-soham deleted the feat/add-pooling-layers-final branch October 16, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants