Loading ...
Sorry, an error occurred while loading the content.

{Disarmed} Re: [GP] Evolution of Neural Networks

Expand Messages
  • paros
    Thanks for the suggestions, but my final goal here was to test out this strange neural network that I m using. It has response constants in each node and a
    Message 1 of 32 , Mar 10, 2008
    • 0 Attachment
      Thanks for the suggestions, but my final goal here was to test out
      this strange neural network that I'm using. It has "response
      constants" in each node and a funny transfer function most of academia
      is not used to using. (See my other posts for a more thorough
      description).

      The goal of using a GA to fit them to images was just so that I can
      rest assured that my neural network is "robust" in the sense that it
      can produce a "wide gamut" of possible outputs. If my bizarre neural
      network is capable of producing hundreds of varying images, I will
      rest assured that it could conceivably produce ANY output, even ones
      in higher dimensional space.


      --- In genetic_programming@yahoogroups.com, "Lucas, Simon M" <sml@...>
      wrote:
      >
      > Paros,
      >
      >
      >
      > You don't say what resolution image you're trying to
      >
      > fit. For hi-res images, it's very hard to do this with MLPs (or NEAT,
      > for that matter),
      >
      > but more straightforward to do with other representations.
      >
      >
      >
      > E.g. if you set up a radial basis function network in the right way,
      >
      > you can eliminate local minima and make it relatively easy to solve.
      >
      >
      >
      > Or of course you could just use a block DCT (like JPEG), and fit it
      > directly (this was
      >
      > not what you're trying to do, I'm just pointing out that you can make
      > this
      >
      > as easy or hard as you like...). Also, better to experiment with
      > monochrome images
      >
      > to begin with.
      >
      >
      >
      > Best wishes,
      >
      >
      >
      > Simon Lucas
      >
      >
      >
      > ps. for this, it's useful to play with simple 2d functions to fit, such
      > as the spiral below,
      >
      > and see how well you can fit it as you increase "turns"
      >
      >
      >
      > public class SpiralFunc {
      >
      > int turns = 16;
      >
      > int turnRate = 1;
      >
      > public double f(double x, double y) {
      >
      > x = x - 0.5;
      >
      > y = y - 0.5;
      >
      > double r = Math.sqrt(x*x + y *y);
      >
      > double theta = Math.atan2(y, x);
      >
      > return Math.sin(turnRate * theta + r * Math.PI * turns);
      >
      > }
      >
      > }
      >
      >
      >
      >
      >
      >
      >
      > From: genetic_programming@yahoogroups.com
      > [mailto:genetic_programming@yahoogroups.com] On Behalf Of A W
      > Sent: 08 March 2008 18:38
      > To: genetic_programming@yahoogroups.com
      > Subject: {Disarmed} Re: [GP] Evolution of Neural Networks
      >
      >
      >
      > I'll start with a question. you said you used a fitness test of
      > euclidean distance in
      > RGB values. This would instinctively be my first choice, What problems
      > did you
      > encounter with this?
      > As far as escaping local maximum, Here a few things to try. {I admit
      > that i'm speculating here}
      >
      > -Maintain several independent populations. Only after a large number of
      > generations, allow crossover
      > to occur between the populations once, then repeat. After a population
      > to population crossover,
      > dump the least fit population and start from scratch with that pop.
      >
      > -Keep the mutation rate low, 1 or 2% and retain 1/3 or so of a
      > population to be random.
      >
      > -Your input of the x,y vector may just not contain enough info. Maybe
      > try adding a third input with
      > something relative to the problem (color delta of x-1,y-1 ect).
      >
      > -Split one or more of your hidden layers into 1/3's, 1 bound to each
      > output to possibly help
      > localize on that desired color.
      >
      > Does your network perform better if you reduce the search to only one
      > color?
      >
      > Aaron.
      >
      > ----- Original Message ----
      > From: paros <paris_o_o@... <mailto:paris_o_o%40yahoo.com> >
      > To: genetic_programming@yahoogroups.com
      > <mailto:genetic_programming%40yahoogroups.com>
      > Sent: Friday, March 7, 2008 21:13:29
      > Subject: [GP] Evolution of Neural Networks
      >
      > I have recently been experimenting with a genetic algorithm to evolve
      > multi-layer perceptrons to produce a particular output.
      >
      > The protoype output is just an image file read in from disk. Weeks
      > ago I thought this would be easy-as-pie and the GA would easily find a
      > network that produces the image as closely as possible. In fact, I
      > only wanted to create this little experiment to ensure that my neural
      > network code was correct and "robust".
      >
      > I completely misjudged this project! I have been through a
      > roller-coaster ride of agony trying to get this to work. I have had
      > to write and re-write and formulate and reformulate the fitness metric
      > for when two images are "close to each other". I *finally* have a
      > good one after a week of solid headache. But I'm still not so sure if
      > it's the best I could be using.
      >
      > (>) The multi-layer perceptron has an input vector of dimension two.
      > Each input corresponds to a 2D coordinate on the image.
      >
      > (>) It has two hidden layers of 24 and 32 nodes respectfully.
      >
      > (>) The output is 3 nodes. Where each node is Red, Green, and Blue
      > respectfully.
      >
      > I would have to write a short story to describe all the different
      > metrics I used for measuring fitness of a candidate image/network. (I
      > did HSV metrics. Number of pixels that are exactly correct. Uhm..
      > euclidean distance in an RGB cube. All sorts of stuff that I will not
      > get into here at this time.) In addition to this headache, I have
      > also had very difficult time stopping the evolutionary process from
      > getting stuck in a local maximum. I have tried numerous methods.
      > I'm not going to cover all of them here (that failed). I will only
      > list some ideas that appear to be working.
      >
      > (>) After crossover, if the image has lower fitness than its parents,
      > it is discarded.
      >
      > (>) After mutation only, if the image has lower fitness than it's
      > previous incarnation, that mutant is discarded.
      >
      > (>) The above two methods makes evolution get out of early local
      > maximums, but not out of later ones. (ugh! here we go again!)
      >
      > (>) So in order to combat the above problem of the population
      > dominated by regime of similar organisms, I have introduced something
      > called a High-Mutation Group. Members of this group are called "High
      > Mutants" and as my program runs the number of active high mutants is
      > displayed. High mutants are created when the algorithm stumbles upon
      > an organism of very low fitness (relative to the population of
      > course). It is replaced by a totally random organism (as if we are
      > starting over). This random organism is not discarded no matter what
      > its fitness. So High Mutants all get a free ticket into the next
      > generation. Mutation itself is too slow to get a population knocked
      > out of a local maximum. The hope is that this pool of highly
      > randomized mutants will get crossed with a regime member and maybe
      > just maybe it will knock the population out its stuck spot.
      >
      > To summarize the agony I have been through in the last few days, the
      > essential struggle is that you don't want mutation to be so high that
      > it DESTROYS high-fitness candidates in your population. But
      > similarly, if you HOLD ON TO high-fitness candidates too much, then
      > your population eventually becomes dominated by them and your
      > population gets stuck in a fascist regime of the same organism and all
      > its children.
      >
      > I don't know how to balance these two competing interests. And it's
      > like if I give up early stuck spots, I only inherit later ones and
      > vice-versa.
      >
      > It's frustrating. It really is.
      >
      > Can anyone in this yahoo group provide me links to publications or the
      > like where someone has tried to evolve networks in this manner? Thank
      > you for your help.
      >
      > <!--
      >
      > #ygrp-mkp{
      > border:1px solid #d8d8d8;font-family:Arial;margin:14px 0px;padding:0px
      > 14px;}
      > #ygrp-mkp hr{
      > border:1px solid #d8d8d8;}
      > #ygrp-mkp #hd{
      > color:#628c2a;font-size:85%;font-weight:bold;line-height:122%;margin:10p
      > x 0px;}
      > #ygrp-mkp #ads{
      > margin-bottom:10px;}
      > #ygrp-mkp .ad{
      > padding:0 0;}
      > #ygrp-mkp .ad a{
      > color:#0000ff;text-decoration:none;}
      > -->
      >
      > <!--
      >
      > #ygrp-sponsor #ygrp-lc{
      > font-family:Arial;}
      > #ygrp-sponsor #ygrp-lc #hd{
      > margin:10px 0px;font-weight:bold;font-size:78%;line-height:122%;}
      > #ygrp-sponsor #ygrp-lc .ad{
      > margin-bottom:10px;padding:0 0;}
      > -->
      >
      > <!--
      >
      > #ygrp-mlmsg {font-size:13px;font-family:arial, helvetica, clean,
      > sans-serif;}
      > #ygrp-mlmsg table {font-size:inherit;font:100%;}
      > #ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean,
      > sans-serif;}
      > #ygrp-mlmsg pre, code {font:115% monospace;}
      > #ygrp-mlmsg * {line-height:1.22em;}
      > #ygrp-text{
      > font-family:Georgia;
      > }
      > #ygrp-text p{
      > margin:0 0 1em 0;}
      > #ygrp-tpmsgs{
      > font-family:Arial;
      > clear:both;}
      > #ygrp-vitnav{
      > padding-top:10px;font-family:Verdana;font-size:77%;margin:0;}
      > #ygrp-vitnav a{
      > padding:0 1px;}
      > #ygrp-actbar{
      > clear:both;margin:25px
      > 0;white-space:nowrap;color:#666;text-align:right;}
      > #ygrp-actbar .left{
      > float:left;white-space:nowrap;}
      > .bld{font-weight:bold;}
      > #ygrp-grft{
      > font-family:Verdana;font-size:77%;padding:15px 0;}
      > #ygrp-ft{
      > font-family:verdana;font-size:77%;border-top:1px solid #666;
      > padding:5px 0;
      > }
      > #ygrp-mlmsg #logo{
      > padding-bottom:10px;}
      >
      > #ygrp-vital{
      > background-color:#e0ecee;margin-bottom:20px;padding:2px 0 8px 8px;}
      > #ygrp-vital #vithd{
      > font-size:77%;font-family:Verdana;font-weight:bold;color:#333;text-trans
      > form:uppercase;}
      > #ygrp-vital ul{
      > padding:0;margin:2px 0;}
      > #ygrp-vital ul li{
      > list-style-type:none;clear:both;border:1px solid #e0ecee;
      > }
      > #ygrp-vital ul li .ct{
      > font-weight:bold;color:#ff7900;float:right;width:2em;text-align:right;pa
      > dding-right:.5em;}
      > #ygrp-vital ul li .cat{
      > font-weight:bold;}
      > #ygrp-vital a{
      > text-decoration:none;}
      >
      > #ygrp-vital a:hover{
      > text-decoration:underline;}
      >
      > #ygrp-sponsor #hd{
      > color:#999;font-size:77%;}
      > #ygrp-sponsor #ov{
      > padding:6px 13px;background-color:#e0ecee;margin-bottom:20px;}
      > #ygrp-sponsor #ov ul{
      > padding:0 0 0 8px;margin:0;}
      > #ygrp-sponsor #ov li{
      > list-style-type:square;padding:6px 0;font-size:77%;}
      > #ygrp-sponsor #ov li a{
      > text-decoration:none;font-size:130%;}
      > #ygrp-sponsor #nc{
      > background-color:#eee;margin-bottom:20px;padding:0 8px;}
      > #ygrp-sponsor .ad{
      > padding:8px 0;}
      > #ygrp-sponsor .ad #hd1{
      > font-family:Arial;font-weight:bold;color:#628c2a;font-size:100%;line-hei
      > ght:122%;}
      > #ygrp-sponsor .ad a{
      > text-decoration:none;}
      > #ygrp-sponsor .ad a:hover{
      > text-decoration:underline;}
      > #ygrp-sponsor .ad p{
      > margin:0;}
      > o{font-size:0;}
      > .MsoNormal{
      > margin:0 0 0 0;}
      > #ygrp-text tt{
      > font-size:120%;}
      > blockquote{margin:0 0 0 4px;}
      > .replbq{margin:4;}
      > -->
      >
      > Send instant messages to your online friends
      > http://uk.messenger.yahoo.com
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • A W
      I still suspect that the net does have enough information in the inputs to provide the proper output. perhaps try adding an extra input that s related to the
      Message 32 of 32 , Mar 17, 2008
      • 0 Attachment
        I still suspect that the net does have enough information in the inputs to provide the proper output.
        perhaps try adding an extra input that's related to the desired out such as an index to the primary color etc and see how they perform with your current training method.

        ----- Original Message ----
        From: paros <paris_o_o@...>
        To: genetic_programming@yahoogroups.com
        Sent: Monday, March 17, 2008 7:16:22
        Subject: [GP] Re: Evolution of Neural Networks

        No actually I'm convinced this fitness metric is good. The problem
        I'm having is one of lack of diversity at the ends of evolution runs.
        The average population fitness hovers around 60 to 75% and doesn't
        go anywhere for 8 hours or more. This is after an explosion in
        fitness in the first hour. It is now totally obvious to me that the
        process is getting caught in a local maximum, and I have no idea how
        to bump it out.

        --- In genetic_programming @yahoogroups. com, John B├Ąckstrand
        <sandos@...> wrote:
        >
        > paros wrote:
        > > The problem is that I'm not getting that. I'm getting dirty tricks
        > > where evolution ignores difficult parts of the image and just banks on
        > > large swaths of color for quick-and-dirty gains on lots of pixels.
        > > Evolution is trying to maximize fitness and is doing so in whatever
        > > underhanded manner it can find. Please see my other posts on this
        > > forum for a screenshot of the results so far.
        >
        > That is neither underhanded nor a trick: You have simply not defined
        > fitness properly, if fit individuals do not please you.
        >
        > ---
        > John B├Ąckstrand
        >




        <!--

        #ygrp-mkp{
        border:1px solid #d8d8d8;font-family:Arial;margin:14px 0px;padding:0px 14px;}
        #ygrp-mkp hr{
        border:1px solid #d8d8d8;}
        #ygrp-mkp #hd{
        color:#628c2a;font-size:85%;font-weight:bold;line-height:122%;margin:10px 0px;}
        #ygrp-mkp #ads{
        margin-bottom:10px;}
        #ygrp-mkp .ad{
        padding:0 0;}
        #ygrp-mkp .ad a{
        color:#0000ff;text-decoration:none;}
        -->

        <!--

        #ygrp-sponsor #ygrp-lc{
        font-family:Arial;}
        #ygrp-sponsor #ygrp-lc #hd{
        margin:10px 0px;font-weight:bold;font-size:78%;line-height:122%;}
        #ygrp-sponsor #ygrp-lc .ad{
        margin-bottom:10px;padding:0 0;}
        -->

        <!--

        #ygrp-mlmsg {font-size:13px;font-family:arial, helvetica, clean, sans-serif;}
        #ygrp-mlmsg table {font-size:inherit;font:100%;}
        #ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean, sans-serif;}
        #ygrp-mlmsg pre, code {font:115% monospace;}
        #ygrp-mlmsg * {line-height:1.22em;}
        #ygrp-text{
        font-family:Georgia;
        }
        #ygrp-text p{
        margin:0 0 1em 0;}
        #ygrp-tpmsgs{
        font-family:Arial;
        clear:both;}
        #ygrp-vitnav{
        padding-top:10px;font-family:Verdana;font-size:77%;margin:0;}
        #ygrp-vitnav a{
        padding:0 1px;}
        #ygrp-actbar{
        clear:both;margin:25px 0;white-space:nowrap;color:#666;text-align:right;}
        #ygrp-actbar .left{
        float:left;white-space:nowrap;}
        .bld{font-weight:bold;}
        #ygrp-grft{
        font-family:Verdana;font-size:77%;padding:15px 0;}
        #ygrp-ft{
        font-family:verdana;font-size:77%;border-top:1px solid #666;
        padding:5px 0;
        }
        #ygrp-mlmsg #logo{
        padding-bottom:10px;}

        #ygrp-reco {
        margin-bottom:20px;padding:0px;}
        #ygrp-reco #reco-head {
        font-weight:bold;color:#ff7900;}

        #reco-grpname{
        font-weight:bold;margin-top:10px;}
        #reco-category{
        font-size:77%;}
        #reco-desc{
        font-size:77%;}

        #ygrp-vital{
        background-color:#e0ecee;margin-bottom:20px;padding:2px 0 8px 8px;}
        #ygrp-vital #vithd{
        font-size:77%;font-family:Verdana;font-weight:bold;color:#333;text-transform:uppercase;}
        #ygrp-vital ul{
        padding:0;margin:2px 0;}
        #ygrp-vital ul li{
        list-style-type:none;clear:both;border:1px solid #e0ecee;
        }
        #ygrp-vital ul li .ct{
        font-weight:bold;color:#ff7900;float:right;width:2em;text-align:right;padding-right:.5em;}
        #ygrp-vital ul li .cat{
        font-weight:bold;}
        #ygrp-vital a{
        text-decoration:none;}

        #ygrp-vital a:hover{
        text-decoration:underline;}

        #ygrp-sponsor #hd{
        color:#999;font-size:77%;}
        #ygrp-sponsor #ov{
        padding:6px 13px;background-color:#e0ecee;margin-bottom:20px;}
        #ygrp-sponsor #ov ul{
        padding:0 0 0 8px;margin:0;}
        #ygrp-sponsor #ov li{
        list-style-type:square;padding:6px 0;font-size:77%;}
        #ygrp-sponsor #ov li a{
        text-decoration:none;font-size:130%;}
        #ygrp-sponsor #nc{
        background-color:#eee;margin-bottom:20px;padding:0 8px;}
        #ygrp-sponsor .ad{
        padding:8px 0;}
        #ygrp-sponsor .ad #hd1{
        font-family:Arial;font-weight:bold;color:#628c2a;font-size:100%;line-height:122%;}
        #ygrp-sponsor .ad a{
        text-decoration:none;}
        #ygrp-sponsor .ad a:hover{
        text-decoration:underline;}
        #ygrp-sponsor .ad p{
        margin:0;}
        o{font-size:0;}
        .MsoNormal{
        margin:0 0 0 0;}
        #ygrp-text tt{
        font-size:120%;}
        blockquote{margin:0 0 0 4px;}
        .replbq{margin:4;}
        -->





        Send instant messages to your online friends http://uk.messenger.yahoo.com

        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.