How to solve the error generated while defining custom FFT layer?
2 次查看(过去 30 天)
显示 更早的评论
Hello
I was trying to create a custom FFT layer but I'm getting errors, either 'cell' data type related as in 'brace indexing isn't supported' or 'data type isn't supported'. The custom layer is followed by a 2d CNN and defined after the imageinputlayer. I have used imagedatastore to keep my training data. The class definition code is attached. I'm getting error for line 55 but I have tried to resolve that and then I get the data type related error.
Thanks in advance.
1 个评论
采纳的回答
Matt J
2025-2-25
编辑:Matt J
2025-2-25
Your predict() method is written to expect that the input X will be a cell array. It's not clear why you expect this, but you shouldn't. The input given to the layers will always be either regular numeric arrays or dlarrays. The outputs need to be likewise.
It is also not entirely clear why you don't use a functionLayer to implement this, rather than a custom layer. You don't appear to be providing a custom backward or forward method, so a custom layer doesn't seem necessary.
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!