question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unify convolution/pooling functions for all spatial dimensionalities

See original GitHub issue

I sometimes saw users that do not know the existence of ConvolutionND and *_pooling_nd. In particular, they say “there is no Convolution1D” (or 3D), although it is supported by the ND version. There are two approaches to resolve this issue.

  1. Make explicit versions for typical dimensionalities (Convolution1D, Convolution3D, …)
  2. Unify them and use it everywhere (Convolution, max_pooling, …)

I feel the second approach is much simpler. As for the Functions, we only have to make an alias of *_nd without the suffix _nd, e.g. convolution, max_pooling, etc. As for the Links, we have to think about how to let it know the dimensionality of the parameters. Thanks to the lazy initialization of the parameters, it can be automatically inferred in most cases, so that we can make Convolution that can be constructed by a code like Convolution(out_size, kernel_size). We can also explicitly specify the spatial dimensionality by ndim option.

Another interesting aspect of this approach is that, once we fix the existing code to use this unified version, the definition of a convnet designed for a specific spatial dimensionality (e.g., 2D) is directly reusable for other spatial dimensionalities (e.g., 1D and 3D), because there is no information about the dimensionality appearing in the model definitions.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mitmulcommented, May 17, 2017

I vote for the 2nd option, to make a unified interface.

0reactions
stale[bot]commented, Jun 16, 2018

This issue is closed as announced. Feel free to re-open it if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convolutional Neural Networks (CNNs / ConvNets)
POOL layer will perform a downsampling operation along the spatial dimensions (width, height), resulting in volume such as [16x16x12].
Read more >
Applied Deep Learning - Part 4: Convolutional Neural Networks
Pooling layers downsample each feature map independently, reducing the height and width, keeping the depth intact.
Read more >
Convolution Layer - an overview | ScienceDirect Topics
So, the pooling layer controls overfitting by progressively minimizing the spatial size of the feature map to reduce the quantity of parameters and...
Read more >
Enhanced mechanisms of pooling and channel attention for ...
The pooling function is vital for deep neural networks (DNNs). The operation is to generalize the representation of feature maps and ...
Read more >
MV-C3D: A Spatial Correlated Multi-View 3D Convolutional ...
Our network architecture contains eight 3D convolution layers, five 3D max-pooling layers, three fully-connected layers, and a softmax function ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found