From: kallaks kklla on
James Allison <james.allison(a)mathworks.com> wrote in message <hnbbk9$di0$1(a)fred.mathworks.com>...
> The sim command (network/sim) may help you in getting the neural network
> model in the right format to use with the genetic algorithm. For example:
>
> function f = fitnessfcn(x)
>
> % define/load network parameters here, or pass them in as parameters to
> fitnessfcn
>
> f = sim(net,x,xi,Ai,T)
>
> You can then use ga to solve the optimization problem (doc ga). If there
> are nonlinear constraints you will also need to define a function that
> evaluates those. Using a genetic algorithm successfully normally
> requires some tuning of the algorithm parameters (such as the number of
> generations, etc.).
>
> If you need further help after reading the documentation and examples
> for network/sim and ga, you can contact technical support
> (www.mathworks.com -> support -> contact support).
>
> -James
>
> kallaks kklla wrote:
> > I want optimize processing parameter of injection molding using genetic
> > algorithm. but I don't how to use objective function from neural network
> > in genetic algorithm to get optimize point. can someone help me.


my input in matrix form, and I name it as testing, so, the fitness function become, "f=sim(net, testing)" right???
From: M Saiful on
Greg Heath <heath(a)alumni.brown.edu> wrote in message <54df818f-3c17-4e8b-a59c-26a099b201d3(a)b7g2000yqd.googlegroups.com>...
> On Mar 11, 11:31 am, "kallaks kklla" <kerkplun...(a)yahoo.com> wrote:
> > I want optimize processing parameter of injection molding using genetic algorithm. but I don't how to use objective function from neural network in genetic algorithm to get optimize point. can someone help me.
>
> What part of your code doesn't work?
>
> dbstop if error
>
> Hope this helps.
>
> Greg


I don't how to generate fitness function from neural network in genetic algorithm.
can u help me????
From: Greg Heath on
On Mar 12, 1:55 am, "M Saiful" <kerkplun...(a)yahoo.com> wrote:
> GregHeath<he...(a)alumni.brown.edu> wrote in message <54df818f-3c17-4e8b-a59c-26a099b20...(a)b7g2000yqd.googlegroups.com>...
> > On Mar 11, 11:31 am, "kallaks kklla" <kerkplun...(a)yahoo.com> wrote:
> > > I want optimize processing parameter of injection molding using genetic algorithm. but I don't how to use objective function from neural network in genetic algorithm to get optimize point. can someone help me.
>
> > What part of your code doesn't work?
>
> > dbstop if error
>
> > Hope this helps.
>
> >Greg
>
> I don't how to generate fitness function from neural network in genetic algorithm.
> can u help me????

y00 = repmat(mean(t,2),1,Ntrn); % Output of constant model
e00 = t-y00; % Error
MSE00 = mse(e00) % Mean-squared-error

y = sim(net,p); % Output of neural net
e = t-y; % Error
MSE = mse(e) % Mean-squared-error

R2 = 1 - MSE/MSE00 % R-squared statistic


Hope this helps.

Greg