Skip to content
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

Request for groups parameter support in Conv2DTranspose/Conv1DTranspose Layer #19871

Open
PhyllisJi opened this issue Jun 18, 2024 · 1 comment
Assignees
Labels
stat:contributions welcome A pull request to fix this issue would be welcome. type:feature The user is asking for a new feature.

Comments

@PhyllisJi
Copy link

Issue type

Support

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

binary

TensorFlow version

tf 2.14.0

Custom code

Yes

OS platform and distribution

Ubuntu 20.04

Mobile device

No response

Python version

3.10

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

I request the addition of the groups parameter to the tf.keras.layers.Conv2DTranspose layer. This feature is crucial for the following reasons:

Enhanced Model Flexibility and Efficiency:
The groups parameter allows for the implementation of grouped transposed convolutions, which can significantly enhance model flexibility and computational efficiency. By splitting the input and output channels into separate groups, it enables the creation of more complex and diverse neural network architectures, such as those found in state-of-the-art models like ResNeXt and MobileNetV2.
Consistency with Other Frameworks:
PyTorch, a widely used deep learning framework, supports the groups parameter in its ConvTranspose2d layer. Including this feature in TensorFlow would align its functionality with PyTorch, facilitating easier migration of models between these frameworks and enhancing interoperability for developers and researchers.
Optimization of Computational Resources:
Grouped convolutions are known to reduce the number of parameters and computational load, which is particularly beneficial for deploying models on resource-constrained devices such as mobile phones and embedded systems. By supporting the groups parameter, TensorFlow can better cater to the needs of edge computing and real-time inference applications.
Broadening Application Scope:

The ability to use grouped transposed convolutions would broaden the scope of applications that TensorFlow can effectively handle, including tasks that require fine-grained control over the convolution operations, such as generative adversarial networks (GANs) and super-resolution models.
Adding groups support to the Conv2DTranspose layer would greatly enhance the usability and versatility of TensorFlow. It would provide developers with a powerful tool for building efficient and advanced neural network architectures, aligning TensorFlow with industry standards and best practices.

Standalone code to reproduce the issue

Current:

tf.keras.layers.Conv1DTranspose(
    filters,
    kernel_size,
    strides=1,
    padding='valid',
    data_format=None,
    dilation_rate=1,
    activation=None,
    use_bias=True,
    kernel_initializer='glorot_uniform',
    bias_initializer='zeros',
    kernel_regularizer=None,
    bias_regularizer=None,
    activity_regularizer=None,
    kernel_constraint=None,
    bias_constraint=None,
    **kwargs
)
@google-ml-butler google-ml-butler bot added the type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited. label Jun 18, 2024
@sachinprasadhs sachinprasadhs added type:feature The user is asking for a new feature. keras-team-review-pending Pending review by a Keras team member. and removed type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited. labels Jun 18, 2024
@jeffcarp
Copy link
Collaborator

How straightforward is the implementation of this? Look like in base Conv2D it's used here:
https://github.com/keras-team/keras/blob/d20f4a73f4a952cd143d123028face90dcc2186d/keras/src/layers/convolutional/base_conv.py#L187C1-L187C42

@jeffcarp jeffcarp added stat:contributions welcome A pull request to fix this issue would be welcome. and removed keras-team-review-pending Pending review by a Keras team member. labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:contributions welcome A pull request to fix this issue would be welcome. type:feature The user is asking for a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants