neural network trained using partical swarm optimization
이전 댓글 표시
Hello
in order to resolve some constraints optimization problem, i use neural network trained by pso algorithm.
to this end i try to simulate the matlab code proposed in:
however, it generate the following error:
Error using network/subsasgn>network_subsasgn (line 551)
net.IW{1,1} must be a 10-by-3 matrix.
Error in network/subsasgn (line 11)
net = network_subsasgn(net,subscripts,v,netname);
Error in myfunc (line 18)
net.iw{1,1}=xi; % net.inputWeights{1,1}
Error in rnn_pso>@(x)myfunc(x,n,m,o,net,inputs,targets)
Error in rnn_pso (line 37)
f0(i,1)=fun(x0(i,:));
the size of used data: 150x7 input, 150x3 target.
how can i overcome it?
Did you already test this code? othwhise, i can post the code for do it.
댓글 수: 4
Sree Ranjini
2017년 4월 28일
Hello,
Did you get the solution for the problem . I am also facing the same problem. I have used the same code https://www.researchgate.net/publication/305325563_Codes_in_MATLAB_for_Training_Artificial_Neural_Network_using_Particle_Swarm_Optimization
M N Alam
2017년 6월 29일
Hi,
Your dataset seems to be problematic. Kindly, put your dataset in the original datafile uploaded with the article. Surely, this will fix the problem as one person faced the similar problem. Thanks
BERGHOUT Tarek
2019년 2월 3일
i used the same code but it works perfectly for any dataset that i used; just check this parameters number of neurons in the hidden layer; nulmber of inputs ; number of outputs ;
ERJEW AYEL D
2021년 10월 28일
Dear,
Could you please tell me how to adjust the output neurons! for example, I have 8 output variables so that the output layer contains 8 neurons!
Thank you in advance!
답변 (1개)
Greg Heath
2017년 6월 29일
0 개 추천
You should have
[ I N ] = size(input) = [ 7 150]
[ O N ] = size(target) = [ 3 150 ]
Hope this helps.
Thank you for formally accepting my answer
Greg
카테고리
도움말 센터 및 File Exchange에서 Function Approximation and Clustering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!