Skip to content

Forward and Gradient-Based Convolution Testing #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 28, 2024

Conversation

AzeezIsh
Copy link
Contributor

This PR introduces a suite of unit tests for convolutions.py located within the within the machine learning and signal processing directories. The primary functions in this file involve neural network convolutions, FFT convolutions, gradient convolutions, and different dimension-based convolutions.

Convolution Operations with Varying Input Shapes
Convolve2 and Convolve3 Operations: Convolution operations return the correct output shape for various input matrix sizes, ensuring that both 2D and 3D convolutions handle input dimensions as expected.
Edge Cases: Includes tests for very small input matrices (e.g., 1x1) and scenarios where kernel sizes are large relative to the input, checking for correct handling of these edge cases.
Data Type Handling
Support for Multiple Data Types: Floating-point precision variants (16-bit, 32-bit, 64-bit) are tested to ensure convolutions work correctly across different numerical representations.
Invalid Data Types: Tests ensure that attempting convolution operations with unsupported data types (e.g., integers, complex numbers) correctly raises errors, preventing undefined behavior.
Convolution Parameters Variability
Strides, Padding, Dilation: Parameterized tests cover various configurations of strides, padding, and dilation, verifying that the output shapes match expected values for each configuration.
Kernel Size Variations: Tests with different kernel sizes confirm that the convolution output adjusts appropriately, ensuring flexibility in convolution kernel selection.
Convolution Modes and Domains
Different Convolution Modes: The effect of changing convolution modes (e.g., default, expand) on the output size and behavior is thoroughly tested.
Convolution Domains: Testing across different convolution domains (e.g., spatial, frequency) to validate that the library correctly implements domain-specific convolution logic.
Gradient Computations
Convolution Gradients: Includes tests for gradient computation through convolutions, covering various gradient types (e.g., filter, data, bias gradients) and ensuring gradients are computed correctly with respect to input data.
Error Handling and Robustness
Invalid Configurations: Checks for negative padding, strides, or dilation sizes, ensuring the library robustly handles invalid inputs by raising exceptions.
Complex Number Handling: Explicit tests for operations involving complex numbers, assessing the library's support for complex convolution operations.

@syurkevi syurkevi merged commit dc6ba81 into arrayfire:master Mar 28, 2024
0 of 3 checks passed
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