Sequential neural network training with 1-D function layer
Show older comments
I'm trying to run a sequential neural network with input shape "ST". I have made a function layer, containing findpeaks. I'd like to perform findpeaks on the first dimension. When I try running the neural network, it tries to batch the data so that a 2-d SxT dlarray is passed into findpeaks, but findpeaks only accepts vectors as input.
Is my only option to put it into a for loop, or is there a way to parallelise it?
Thanks in advance.
1 Comment
That doesn't appear to be your biggest problem. Your biggest problem is that the operations allowed in a functionLayer are restricted to the those compatible with dlarray input,
But findpeaks is not in the list of supported functions for dlarrays,
Nor does it seem to me that it ever could be. A findpeaks operations is not obviously differentiable in any way.
Unless for some reason findpeaks is not intended to be part of the differentiable chain of operations done by the network, I think you probably need a different approach to whatever you are doing.
Answers (0)
Categories
Find more on Sequence and Numeric Feature Data Workflows 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!