Do we need to reinitialized the weight using "init(net)" to reinitialized the weights in ANN training loop?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, i need help on whether should re-initialized the weight when looping the training for different neurons number? will the training function re-initialized the weight by defautlt? the code i used are as follows. thank you very much.
N = [5 10 15 20 25 30 35 40 45 50 55 60];
trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation.
%name the ANN NNxxpts
NNVFBRReal200_5_to_60_all = cell(length(N),1) ;
P = zeros(length(N),1) ;
for i = 1:length(N)
% Create a Fitting Network & set number of neurons
hiddenLayerSize = N(i);
net = init(net);
net = fitnet(hiddenLayerSize,trainFcn);
net.performFcn = 'mse'; % Mean Squared Error
% Choose Plot Functions
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotregression'};
[net,tr] = train(net,X,T);
nntraintool
NNVFBRReal200_5_to_60_all{i} = net ;
testX = X(:,tr.testInd);
testT = T(:,tr.testInd);
testY = net(testX);
perf = mse(net,testT,testY) ;
P(i) = perf ;
end as i encountered very high MSE when using trainBr. as below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197932/image.jpeg)
please help. however , in another case, it only occured at neurons = 35
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197933/image.jpeg)
Please help. thanks
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Define Shallow Neural Network Architectures dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!