Azzera filtri
Azzera filtri

neural network regression model error

1 visualizzazione (ultimi 30 giorni)
aman hari
aman hari il 14 Lug 2019
Risposto: Divya Gaddipati il 17 Lug 2019
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

Risposte (1)

Divya Gaddipati
Divya Gaddipati il 17 Lug 2019
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.

Categorie

Scopri di più su Deep Learning Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by