Deep Learning Toolbox: Layer 'regressionoutput': Detected output layer. The network must not have output layers.

41 次查看(过去 30 天)
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.

采纳的回答

Sai Kiran
Sai Kiran 2023-3-9
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 个评论
Mircea Susca
Mircea Susca 2023-3-10
Thank you very much! I didn't know why it's not acceptable in this case; I'll investigate the indicated examples and adapt accordingly.
Imrana
Imrana 2024-1-23
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by