training the neural network and then maximising the outputs using genetic algorithm

this is my code for training data using code.
inputs = [x1;x2;x3];
targets = [y1;y2];
hiddenlayersize = 10;
net = fitnet(hiddenlayersize);
net.divideparam.trainratio = 85/100;
net.divideparam.valratio = 5/100;
net.divideparam.testratio = 10/100;
[net,tr] = train(net,inputs,targets);
outputs = net(inputs);
errors = gsubtract(outputs,targets);
performance = perform(net,targets,outputs);
view(net);
figure,plotregression(targets,outputs);
Now, i want to maximise both the outputs y1 and y2 using the genetic algoritm (gamultiobj), but i don't understand how can we find the objective function from the above trained data for using in genetic algorithm.
also suggest a good training code for the inputs and outputs.

 채택된 답변

Corrections:
1. Use x, t and y to represent input, target and output, respectively.
2. Your inputs and targets are incompatible because the number of columns are different.
3. Use the functional form of the net output in the fitness function:
y = repmat( b2, O, N) + LW * tanh( repmat(b1, I, N ) + IW * x);
4. Either use norm(y) = sqrt( y(1,:).^2 + y(2,:).^2) or it's square as the GA objective to be maximized.
Hope this helps.
*Thank you for formally accepting my answer*
Greg

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2015년 6월 12일

편집:

2015년 6월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by