Thread Subject: how to use objective function from neural network to optimize using genetic algorithm

Subject: how to use objective function from neural network to optimize using genetic algorithm

From: kallaks kklla

Date: 11 Mar, 2010 16:31:23

Message: 1 of 6

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.

Subject: how to use objective function from neural network to optimize

From: Greg Heath

Date: 11 Mar, 2010 17:29:33

Message: 2 of 6

On Mar 11, 11:31 am, "kallaks kklla" <kerkplun...@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

Subject: how to use objective function from neural network to optimize

From: James Allison

Date: 11 Mar, 2010 18:09:13

Message: 3 of 6

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.

Subject: how to use objective function from neural network to optimize

From: kallaks kklla

Date: 12 Mar, 2010 03:32:04

Message: 4 of 6

James Allison <james.allison@mathworks.com> wrote in message <hnbbk9$di0$1@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???

Subject: how to use objective function from neural network to optimize

From: M Saiful

Date: 12 Mar, 2010 06:55:05

Message: 5 of 6

Greg Heath <heath@alumni.brown.edu> wrote in message <54df818f-3c17-4e8b-a59c-26a099b201d3@b7g2000yqd.googlegroups.com>...
> On Mar 11, 11:31 am, "kallaks kklla" <kerkplun...@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????

Subject: how to use objective function from neural network to optimize

From: Greg Heath

Date: 13 Mar, 2010 06:08:41

Message: 6 of 6

On Mar 12, 1:55 am, "M Saiful" <kerkplun...@yahoo.com> wrote:
> GregHeath<he...@alumni.brown.edu> wrote in message <54df818f-3c17-4e8b-a59c-26a099b20...@b7g2000yqd.googlegroups.com>...
> > On Mar 11, 11:31 am, "kallaks kklla" <kerkplun...@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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
objective function M Saiful 11 Mar, 2010 11:34:28
neural network M Saiful 11 Mar, 2010 11:34:28
genetic algorithm M Saiful 11 Mar, 2010 11:34:28
rssFeed for this Thread

Contact us at files@mathworks.com