grid fitness distribution question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

grid fitness distribution question

Bryan Auslander
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
- From following the examples I have created an application that should
distribute the fitness calculations across multiple workers. The fitness
calculation takes about 3 minutes to run per chromosome so it is
essential it is distributed.

However in the example for fitness distribution it uses the line
pop.sortByFitness() which causes all the fitness calculations to then be
done for each chromosome on the client before the requests are split up
for the workers?   Removing this line does send the fitness requests to
the workers.  This line is need though as pointed out in the example
snce they need to be sorted here in order to keep the best chromosomes
for when the population gets bigger.  As such I am wondering if this
might be a bug in the example or if I am missing something.

I have a similar issue when it is working on the evolving.  I would have
thought that the way that the fitness distribution was implemented that
any time it needed a fitness it would pass it to a worker.   However
during the evolving it calculates the fitness of new chromosomes as they
are generated, which by default is handled on the client.  I see some
examples on distributing the evolving, but this seems like it should be
for a different purpose.

Any advice on how to fix these issues would be appreciated.

Thanks,
Bryan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJLE/0AAAoJEIB5nnZY0MtS9jAH+wVjezxDyorOfS4gyLmyKcgc
YJskmUPj9Sts8N4iZfLP0xCgGo2DNjAqIIpbNUPhb3j59pTwmoTXYwEWp4PuO2Zi
BofSGoNlh2C8SPl1Ycl8kAMUhuMCvBkFHMFnxdRByoD1pkCMHlzk49Jjt+P51yik
irw2UTzjrfYh3wyFaL/vCnJTELncdqDkLRcPHPwlBijrQxL6fB6xbbVzrbgILQ7d
aqdXrJKgsgzSYUBajky/pCo15kqpnS8HeRPu6/fhQAAXuT8svyt5U9z9zqKpHf1K
7Klp0RYiTdQvQHtxoYaZP4ML8py3H515KCUVGaFecxTuXxQwaU91L/q7IxKYgGk=
=0BaT
-----END PGP SIGNATURE-----


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: grid fitness distribution question

Klaus Meffert-5
Bryan,

thanx a lot for your detailled descriptions and observations.

Regarding pop.sortByFitness() in class
examples.grid.fitnessDistributed.MyRequestSplitStrategy it seems as only for
the first time (before any request was sent to the workers) the calculation
of fitness is done on the client. In subsequent calls the fitness is known
as needn't be calculated again. My fix would avoid calling sortByFitness the
first time. Here is my proposal (the inserted lines are marked with "+"):
-- snip (class examples.grid.fitnessDistributed.MyRequestSplitStrategy
...
  public JGAPRequest[] split(JGAPRequest a_request)
      throws Exception {
    Population pop = a_request.getPopulation();
    // Sort Population to only work with the most fittest individuals.
    // This is necessary as a Population can grow further than given
    // with the Configuration (it has to do with performance, sorry).
    // ---------------------------------------------------------------
+    if (m_config.getGenerationNr() > 0) {
+      // Only sort by fitness after the initial generation as in
+      // generation 0 no requests have been processed on the workers.
+      // ------------------------------------------------------------
+      pop.sortByFitness();
+    }
...
--- snap

Regarding new chromosomes: I think you are right. The call to evaluate the
fitness has to be adapted. I will offer a solution for this (maybe as an
xmas present ;-) ).

Thanx again and best

Klaus
www.klaus-meffert.com

 

> -----Original Message-----
> From: Bryan Auslander [mailto:[hidden email]]
> Sent: Monday, November 30, 2009 6:13 PM
> To: [hidden email]
> Subject: [jgap-users] grid fitness distribution question
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>  
> - From following the examples I have created an application
> that should distribute the fitness calculations across
> multiple workers. The fitness calculation takes about 3
> minutes to run per chromosome so it is essential it is distributed.
>
> However in the example for fitness distribution it uses the line
> pop.sortByFitness() which causes all the fitness calculations
> to then be done for each chromosome on the client before the
> requests are split up
> for the workers?   Removing this line does send the fitness
> requests to
> the workers.  This line is need though as pointed out in the
> example snce they need to be sorted here in order to keep the
> best chromosomes for when the population gets bigger.  As
> such I am wondering if this might be a bug in the example or
> if I am missing something.
>
> I have a similar issue when it is working on the evolving.  I
> would have thought that the way that the fitness distribution
> was implemented that
> any time it needed a fitness it would pass it to a worker.   However
> during the evolving it calculates the fitness of new
> chromosomes as they are generated, which by default is
> handled on the client.  I see some examples on distributing
> the evolving, but this seems like it should be for a
> different purpose.
>
> Any advice on how to fix these issues would be appreciated.
>
> Thanks,
> Bryan
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>  
> iQEcBAEBAgAGBQJLE/0AAAoJEIB5nnZY0MtS9jAH+wVjezxDyorOfS4gyLmyKcgc
> YJskmUPj9Sts8N4iZfLP0xCgGo2DNjAqIIpbNUPhb3j59pTwmoTXYwEWp4PuO2Zi
> BofSGoNlh2C8SPl1Ycl8kAMUhuMCvBkFHMFnxdRByoD1pkCMHlzk49Jjt+P51yik
> irw2UTzjrfYh3wyFaL/vCnJTELncdqDkLRcPHPwlBijrQxL6fB6xbbVzrbgILQ7d
> aqdXrJKgsgzSYUBajky/pCo15kqpnS8HeRPu6/fhQAAXuT8svyt5U9z9zqKpHf1K
> 7Klp0RYiTdQvQHtxoYaZP4ML8py3H515KCUVGaFecxTuXxQwaU91L/q7IxKYgGk=
> =0BaT
> -----END PGP SIGNATURE-----
>
>
> --------------------------------------------------------------
> ----------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> jgap-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jgap-users


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users