From: Yeo on 20 Mar 2010 23:21 Hello all, I have a NN built using the MATLAB toolbox to predict a yield stress of a metal given its composition and conditions. I predicted the outputs. Now I have to employ Genetic Algorithm (GA) to optimise my inputs to reach my desired output. I understand there is a toolbox to do so and uses a function [x , fval] = ga(@fitnessfcn,no.ofvars). My thinking now is to put in my output into the GA so it can determine the best input to obtain the output. However, I have trouble determining my fitness function. They should be derived from my outputs and its derivations. Should it be just: function f = fitnessfcn(DesiredTargets,PredictedTargets) f = Desired Targets - Predicted i.e. the residuals since I want to minimize the residuals I believe my no.ofvars should be 2 since I have Desired and Predicted targets in my function. And my desired targets have a dimension of 1x100. Is my approach i.e. minimizing the residuals correct in order to optimize my inputs? I am a bit doubtful because I want to optimize the process not the NN model. Any advice would be helpful. Thanks.
From: Ajay on 22 Mar 2010 08:36 Your optimization function (say objective.m or any name) should create output using the inputs x(1), x(2). I am assuming two variables function [out] = objective (x) Now use this function in GA (@objective) as objective function. I frequently use the GA Tool (GUI) and due to GUI it is more comforatble to use. type gatool in the command line of matlab.... I hope it helps you.... "Yeo " <yeocr88(a)gmail.com> wrote in message <ho43au$mu7$1(a)fred.mathworks.com>... > Hello all, > > I have a NN built using the MATLAB toolbox to predict a yield stress of a metal given its composition and conditions. I predicted the outputs. Now I have to employ Genetic Algorithm (GA) to optimise my inputs to reach my desired output. I understand there is a toolbox to do so and uses a function [x , fval] = ga(@fitnessfcn,no.ofvars). > > My thinking now is to put in my output into the GA so it can determine the best input to obtain the output. > > However, I have trouble determining my fitness function. They should be derived from my outputs and its derivations. Should it be just: > > function f = fitnessfcn(DesiredTargets,PredictedTargets) > > f = Desired Targets - Predicted i.e. the residuals since I want to minimize the residuals > > I believe my no.ofvars should be 2 since I have Desired and Predicted targets in my function. And my desired targets have a dimension of 1x100. > > Is my approach i.e. minimizing the residuals correct in order to optimize my inputs? I am a bit doubtful because I want to optimize the process not the NN model. > > Any advice would be helpful. > > Thanks.
From: Yeo on 22 Mar 2010 11:07 Thanks for your reply, I am having trouble determining how to obtain the optimized input set from the GA. The fitness function wont work unless it returns a scalar i.e. I can minimize the variance and RMS errors. But, I'm still unsure how to get the optimized output set from my GA i.e. 1x100 in size. Is it because my fitness function is incorrect? Or it cannot be done in such a way using the toolbox? Regards. "Ajay " <ajaydashora(a)gmail.com> wrote in message <ho7o7k$642$1(a)fred.mathworks.com>... > Your optimization function (say objective.m or any name) should create output using the inputs x(1), x(2). I am assuming two variables > > function [out] = objective (x) > > Now use this function in GA (@objective) as objective function. I frequently use the GA Tool (GUI) and due to GUI it is more comforatble to use. type gatool in the command line of matlab.... > > I hope it helps you.... > > > > > "Yeo " <yeocr88(a)gmail.com> wrote in message <ho43au$mu7$1(a)fred.mathworks.com>... > > Hello all, > > > > I have a NN built using the MATLAB toolbox to predict a yield stress of a metal given its composition and conditions. I predicted the outputs. Now I have to employ Genetic Algorithm (GA) to optimise my inputs to reach my desired output. I understand there is a toolbox to do so and uses a function [x , fval] = ga(@fitnessfcn,no.ofvars). > > > > My thinking now is to put in my output into the GA so it can determine the best input to obtain the output. > > > > However, I have trouble determining my fitness function. They should be derived from my outputs and its derivations. Should it be just: > > > > function f = fitnessfcn(DesiredTargets,PredictedTargets) > > > > f = Desired Targets - Predicted i.e. the residuals since I want to minimize the residuals > > > > I believe my no.ofvars should be 2 since I have Desired and Predicted targets in my function. And my desired targets have a dimension of 1x100. > > > > Is my approach i.e. minimizing the residuals correct in order to optimize my inputs? I am a bit doubtful because I want to optimize the process not the NN model. > > > > Any advice would be helpful. > > > > Thanks.
|
Pages: 1 Prev: Suppression of Carriage Return. Next: Callback simulink parameters to edit text box in GUI |