How to transfer a 1D-CNN from Tensorflow?
Show older comments
I'm trying to recreate the CNN to MATLAB from this paper: https://doi.org/10.1021/acs.analchem.8b05821. In the code uploaded to GitHub, the authors use a series on Conv1D layers which is equivalent to MATLAB's convolution1dLayer. Their inputs are 250x36 onehot encoded matrices. The network slides convolutional filters along the longer dimension of this matrix to extract features and use them for regression purposes.
However, when I try to feed the network similar matrices, I receive an "Input data must have one spatial dimension only" error message at the first convolution layer. Am I supposed to flatten the input matrix first before the convolutional layer? I didn't find any evidence for such an operation in the code. Or is there any workaround to this using a 2D convolution layer?
Accepted Answer
More Answers (1)
David Willingham
on 6 Jun 2022
0 votes
Hi, are you trying to create the network from scratch? Or does the paper have a link to the TensorFlow code on GitHub?
1 Comment
Daniel Papp
on 6 Jun 2022
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!