Deep Learning Toolbox: Layer 'regressionoutput': Detected output layer. The network must not have output layers.
58 views (last 30 days)
Show older comments
Hello,
I am using the Deep Learning Toolbox with a predefined example from the documentation, for a regression problem:
numFeatures = 15;
numResponses = 10;
numHiddenUnits = 100;
layers = [
sequenceInputLayer(numFeatures)
lstmLayer(numHiddenUnits,OutputMode="last")
fullyConnectedLayer(numResponses)
regressionLayer];
dlnet = dlnetwork(layers);
I cannot find any cause for it and I didn't find any suggestions online regarding this. I just want to test a simple STFT layer with a vector inputs of a certain fixed length.
Error using dlnetwork/initialize
Invalid network.
Error in dlnetwork (line 218)
net = initialize(net, dlX{:});
Error in test_stft_layer (line 37)
dlnet = dlnetwork(layers);
Caused by:
Layer 'regressionoutput': Detected output layer. The network must not have output layers.
0 Comments
Accepted Answer
Sai Kiran
on 9 Mar 2023
Hi,
The regressionLayer is not supported in dlnetwork, you have to define custom loss function if you use the dlnetwork. Please refer to the following example on workflow for dlnetwork.
Please refer to the following example on how to implement regression using LSTM in MATLAB.
I hope it helps!
Thanks.
2 Comments
Imrana
on 23 Jan 2024
I have a question here, how do we apply lstm network to irregular data. Are we able to use neuralODELayer but then it throws an error "invalid Network"?
Can you please help me out with any example?
Best Regards,
Imrana
More Answers (0)
See Also
Categories
Find more on Image 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!