Add support for Torch's Conv1d strides and ConvTranspose1d #145
+1,502
−3
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.
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
. Seetorch_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 theConv1D
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. Seetorch_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 ofConv1D
andConv2D
. 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