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

2 ビュー (過去 30 日間)
sethu
sethu 2015 年 6 月 12 日
編集済み: sethu 2015 年 6 月 16 日
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.

採用された回答

Greg Heath
Greg Heath 2015 年 6 月 13 日
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 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by