What can I do to make the output characteristic of the network is two value, that is the implement multivariate input and multivariable output

I want to change the network structure to achieve that the predicted value of the output is two features. the net work is as follows link, but i can't realize my idea. please help me, thank you very much. hope you have a nice day!

 採用された回答

Taylor
Taylor 2024 年 9 月 12 日
numResponses in your code is the value that determines the number of outputs from your network. Change that from "1" to "2" to get two outputs. Your "Y" variables will also need to be modified to contain two responses as well.

5 件のコメント

Yi Ma
Yi Ma 2024 年 9 月 13 日
thank you for your answer , i have chagne 1 to 2 as the first image, and change the output value to 101 and 102 two columns as the second image, but after running, it will showed :
The assignment cannot be performed because the size on the left side is 1×1 and the right side is 2×1.
error the line 85: YrTrain(i,1) = outputn_train(:,i);
the line 85 is showed in third image. if you know why, please tell me, thank you very much! have a nice day!
Taylor
Taylor 2024 年 9 月 13 日
YrTrain(i,1) is an array with size 1x1 and you are trying to assign the value outputn_train(:,1) which has a size of 2x1. You do not get this error on the previous line because XrTrain{i,1} is a cell array (indicated by the curly brackets instead of parentheses).
Yi Ma
Yi Ma 2024 年 9 月 19 日
thank your answer, if you know how to solve the problem, please tell me, very thanks!
YrTrain(i,1) is a numeric array that only has space for one number. outputn_train(:,1) is a numeric array that contains two numbers, so it will not fit into YrTrain(i,1) when you try to assign it in line 85. That is what is meant by "The assignment cannot be performed because the size on the left side is 1×1 and the right side is 2×1". Line 84 runs sucessfully becuase XrTrain is a cell array, as indicated by the curly brackets. There are multiple ways to edit line 85 so that it runs sucessfuly. You could make YrTrain a cell array like XrTrain by using curly brackets:
YrTrain{i,1} = ourputn_train(:,i);
You could also just increase the size of the numeric array:
YrTrain(i,:) = outputn_train(:,i);
Yi Ma
Yi Ma 2024 年 9 月 20 日
it's very uesful! thank you, hope you have a nice day!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索

質問済み:

2024 年 9 月 12 日

コメント済み:

2024 年 9 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by