필터 지우기
필터 지우기

neural network regression model error

조회 수: 1 (최근 30일)
aman hari
aman hari 2019년 7월 14일
답변: Divya Gaddipati 2019년 7월 17일
i used the following data to generate a dataset nd to train the network as shown but is getting the following error can someone help why this error comes
x = rand(1000,1);
y = sin(x)
options = trainingOptions('adam','Plots','training-progress','MaxEpochs',100)
net = trainNetwork(transpose(x),transpose(y),layers_1,options);
ERROR:
Training on single CPU.
|========================================================================================|
| Epoch | Iteration | Time Elapsed | Mini-batch | Mini-batch | Base Learning |
| | | (hh:mm:ss) | RMSE | Loss | Rate |
|========================================================================================|
Error using trainNetwork (line 165)
To RESHAPE the number of elements must not change.
Caused by:
Error using reshape
To RESHAPE the number of elements must not change.
Network MODEL:
Capture.JPG

답변 (1개)

Divya Gaddipati
Divya Gaddipati 2019년 7월 17일
As I understand, your input dataset, “x” has size 1000 x 1 and the output, “y” has size 1000 x 1 and you are defining a regression model for predicting “y”.
In your model, the number of neurons in the last FC layer should match the dimension of “y”. Since, your output is 1-dimensional, the output size of the last Fully Connected (FC) layer used should also be 1. In case, your output “y” is of size 1000 x 2, then the output size of the FC layer should be 2.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by