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

Conv1D support #112

Open
aspaul20 opened this issue Aug 30, 2022 · 2 comments
Open

Conv1D support #112

aspaul20 opened this issue Aug 30, 2022 · 2 comments

Comments

@aspaul20
Copy link

Hi, I wanted to ask if 1D convolutions are supported in FINN-hlslib. If not,

  1. Could we treat the 1D data as "images" with tricks like padding etc. to get it to work with the existing layer?
  2. Are there are any resources that will help me get started with a custom implementation of Conv1D?
    Thanks.
@fpjentzsch
Copy link
Contributor

Hi, Conv1D is supported by combining a 1D variant of the ConvolutionInputGenerator (slidingwindow.h) and a normal MVAU (Matrix_Vector_Activate_Batch).

If you plan on using the FINN compiler: You can refer to this FINN-example to see the build-flow for a 1D CNN:
https://github.com/Xilinx/finn-examples/tree/main/build/vgg10-radioml

Most importantly, you will need to apply the Change3DTo4DTensors() transformation (https://github.com/Xilinx/finn-examples/blob/main/build/vgg10-radioml/custom_steps.py#L37) early on, since FINN works with 4D (NHWC) tensors internally, even for feature maps with only 1 spatial dimension.

@aspaul20
Copy link
Author

Thanks for replying. I am not planning to use the compiler, I will use the library to implement the model.

Is this the variant you're referring to?

Also, other than the ConvolutionInputGenerator, what else would have to be changed in the standard convlayer?

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

No branches or pull requests

2 participants