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

Add support for Torch's Conv1d strides and ConvTranspose1d #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fcaspe
Copy link

@fcaspe fcaspe commented Sep 24, 2024

Hi Jatin!

This library is really awesome, I have been using it for low latency inference of big convolutional autoencoders, so I have implemented the 1d Transposed Convolution and convolutional strides.

  • ConvTranspose1d is implemented with RTNeural's Conv1D class, but a different loading function has to be called, RTNeural::torch_helpers::loadConvTranspose1D. See torch_convtranspose1d_test.cpp for an example.

  • Conv1d strides are implemented using a .skip() method that performs a single stride step. This just updates the circular buffer of the Conv1D layer with the new input we jump over. For example, if strides=2 is required, then .skip() has to be called every time after a .forward() call is made. See torch_conv1d_stride_test.cpp for an example.

I know these new functionalities are not fully incorporated into the library. For instance, strides are still missing in Conv1DT and the non-streaming versions of Conv1D and Conv2D. Let me know what you think about these additions and I will be happy to improve them so that hopefully they can be integrated into the library!

Best,
Franco

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.

1 participant