[galib] GA program

Peter Jay Salzman p at dirac.org
Tue Nov 20 09:47:09 EST 2007


Hi Chris and Anselmo,

You guys just totally made my day!   Thank you so kindly!

Anselmo, I was a professor, and I dearly loved teaching, but was let go
due to budget cuts.  I found it nearly impossible to get another teaching
position that was close to where I was living.

A friend had suggested I look for employment on Wall street with a finance
company.  I found a job in just a few weeks, and here I am.

I do miss teaching very much, although I have to say that getting paid very
well to play with and learn all kinds of technologies is very cool too... 
Each and every day is a learning experience, and the company treats me very,
very well.

Still, I do miss teaching very much, and might go back to it if I found a
nice place to live.  New York is great, but I think all my years in northern
California has made me appreciate a cleaner, less stressed way of living.

There's openings for a professor of physics at both College of Bahamas and
College of Virgin Islands.  It's awfully tempting...   :-D

Best regards,
Pete




On Mon 19 Nov 07, 12:25 PM, Chris Chapman <cnchapman at msn.com> said:
>Agreed! 
> 
>Peter, thanks for taking the time to post such thoughtful answers.  Even
>if the asker in question does not profit, I believe many others will.
> 
>-- chris
>
>> Date: Mon, 19 Nov 2007 17:00:41 -0200
>> From: anselmop at sc.usp.br
>> To: galib at mit.edu
>> Subject: Re: [galib] galib Digest, Vol 52, Issue 6
>>
>> You must be a good teacher. I hardly ever see such an elegant answer!
>>
>> Anselmo Pitombeira
>>
>>
>>
>> galib-request at mit.edu escreveu:
>> > Send galib mailing list submissions to
>> > galib at mit.edu
>> >
>> > To subscribe or unsubscribe via the World Wide Web, visit
>> > http://mailman.mit.edu/mailman/listinfo/galib
>> > or, via email, send a message with subject or body 'help' to
>> > galib-request at mit.edu
>> >
>> > You can reach the person managing the list at
>> > galib-owner at mit.edu
>> >
>> > When replying, please edit your Subject line so it is more specific
>> > than "Re: Contents of galib digest..."
>> >
>> >
>> > Today's Topics:
>> >
>> > 1. Re: GA program (Peter Jay Salzman)
>> >
>> >
>> > ----------------------------------------------------------------------
>> >
>> > Message: 1
>> > Date: Fri, 16 Nov 2007 16:45:11 -0500
>> > From: Peter Jay Salzman <p at dirac.org>
>> > Subject: Re: [galib] GA program
>> > To: GALib Mailing List <galib at mit.edu>
>> > Message-ID: <20071116214511.GA24158 at dirac.org>
>> > Content-Type: text/plain; charset=iso-8859-1
>> >
>> > Hi Somnath,
>> >
>> >
>> > On Sat 17 Nov 07, 12:17 AM, Somnath Bhattacharjee
><sn.bhattacharjee at yahoo.co.in> said:
>> >
>> >> I want to solve the Quadratic equation y= x*x+5*x+6.
>> >> According to manual calculation the result will be two roots ( -3 and
>-2 ,
>> >> for these values of x the function value will be ZERO ).
>> >>
>> >
>> > OK, that's what I suspected.
>> >
>> >
>> >> Now by GA the
>> >> results (means the roots) should be nearly -3 and -2 (not exactly
>-3,-2).
>> >> I'm not sure that it is right or not. I'm beginner in GA so your
>> >> suggestion will be benchmark for me.
>> >>
>> >
>> > There's nothing wrong with being a beginner. I'm a beginner too, both
>with
>> > GAs in general and with GALib. Let me point out a few things that I
>noticed
>> > about your code.
>> >
>> >
>> > First off, you have the following line of code in your program:
>> >
>> >     ga.minimize();
>> >
>> > What do you suppose this line of code does? Compare that with what you
>> > want to accomplish.
>> >
>> >
>> >
>> > Secondly, look at your objective function:
>> >
>> >
>> >> GABin2DecPhenotype map;
>> >> map.add(16, -3, -2);
>> >> map.add(16, -3, -2);
>> >>
>> >> ...
>> >>
>> >> float
>> >> objective(GAGenome & c)
>> >> {
>> >> GABin2DecGenome & genome = (GABin2DecGenome &)c;
>> >> float y=6.0;
>> >> y += genome.phenotype(0) * genome.phenotype(0);
>> >> y += 5 * genome.phenotype(0);
>> >> return y;
>> >> }
>> >>
>> >
>> > You have two genes in your genome.
>> >
>> > Your objective function is a function of only one variable. It says
>> > a whole lot about genome.phenotype(0). What does it have to say about
>> > genome.phenotype(1)? GALib knows how fit phenotype(0) is because
>> > objective() returns a fitness score that's a function of phenotype(0).
>> >
>> > But the objective is not a function of phenotype(1). How does GALib
>> > know how fit phenotype(1) is?
>> >
>> >
>> > Thirdly, look at the "roots" that GALib is giving to you. You have two
>> > numbers (note: increase the number of generations to see the "root
>> > values" more clearly.) Now focus on the meaning of this:
>> >
>> >
>> > ga.minimize();
>> >
>> >
>> > Notice anything? If so, you've just discovered what
>> > genome.phenotype(0) really is. Now the question is, what is
>> > genome.phenotype(1)?
>> >
>> > To find out what phenotype(1) is, turn your mutation and crossover
>> > probabilities way, way down to almost zero. Take a look at what the
>> > starting values are for your two genes, before you evolve the system.
>> > Now evolve the system and look at the final values.
>> >
>> > You should be able to guess what genome.phenotype(1) is from this.
>> >
>> >
>> > Lastly, you set your gene value boundaries to fall exactly on the
>> > two numbers you were expecting GALib to find. I don't really know
>> > much about GAs myself, but I wonder if that's a good strategy.  It
>> > could be, but until I learned a bit more about GAs, I'd probably
>> > put the expected values on the "inside" of the search domain, not
>> > on its boundary.
>> >
>> > Weird things can happen on boundaries.
>> >
>> >
>> > Again, I'm new to all this too, so perhaps all this is wrong, so take
>> > everything I say with a grain of salt.
>> >
>> > Pete

-- 
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D
Last night I dreamt of 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0

"A mathematician is a machine for converting coffee    p at dirac.org
 into theorems."     -- Paul Erdös                     http://www.dirac.org



More information about the galib mailing list