# How can I get the 3 minimum values of this plot?

3 visualizzazioni (ultimi 30 giorni)
Bob il 6 Nov 2022
Risposto: KSSV il 7 Nov 2022
How can I get the number of neurons on which I get the smallest RMSE for Training, Validation and Test set.
for i = 1:60
net = feedforwardnet(i);
net.trainParam.epochs = 300;
[net, tr] = train(net, input, output, 'useparallel', 'yes');
pnet_train = net(input(:,tr.trainInd)); % prediction
tnet_train = output(:,tr.trainInd); % target
rmse_train(i) = sqrt(mean((pnet_train - tnet_train).^2));
pnet_vali = net(input(:,tr.valInd)); % prediction
tnet_vali = output(:,tr.valInd); % target
rmse_vali(i) = sqrt(mean((pnet_vali - tnet_vali).^2));
pnet_test = net(input(:,tr.testInd)); % prediction
tnet_test = output(:,tr.testInd); % target
rmse_test(i) = sqrt(mean((pnet_test - tnet_test).^2));
end
figure;
plot(1:60,rmse_train,'LineWidth',2)
hold on;
plot(1:60,rmse_vali,'LineWidth',2)
hold on;
plot(1:60,rmse_test,'LineWidth',2)
title('Performance');
legend('Training','Validation','Test');
xlabel('Neurons');
ylabel('RMSE');
axis auto;
grid on;
##### 2 CommentiMostra NessunoNascondi Nessuno
the cyclist il 6 Nov 2022
Modificato: the cyclist il 6 Nov 2022
What information do you have?
• Only the image?
• The figure file for the image?
• The data that was used to create the image?
Bob il 7 Nov 2022
Hi!
Thank you for responding.

Accedi per commentare.

### Risposta accettata

KSSV il 7 Nov 2022
REad about min. You have saved rmse of train, validatioon and testing. Use the function min and get the index. I would say check it for train and pick this index.
[val,idx] = min(rmse_train) ;
[idx rmse_train(idx) rmse_vali(idx) rmse_test(idx)]
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Define Shallow Neural Network Architectures 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