Add support for grouped convolutions #2485
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR I will try to add support for grouped convolutions in dlib.
I never had any interest/use for this kind of convolutions until yesterday, when I read this paper: A ConvNet for the 2020s.
The paper explores the main additions in Transformer networks and adds them to a convolutional network.
It makes use of recent additions to dlib:
Unfortunately, it makes also use of grouped convolutions, which are not currently supported in dlib.
That was the motivation I needed. So far I've written:
The gpu part is relatively easy, since it's just a matter of using the CuDNN API.
The cpu part might take longer to complete (I don't think I'll ever use it, but I will try to add it for completeness.)
I've already implemented the ConvNeXt models described in the paper, and the forward pass seems to work.
Let me know if the approach is sensible.