# [SciPy-User] Parallel Differential Evolution

MalAndrea malandrea80@gmail....
Wed Dec 5 17:48:58 CST 2012

```Hi,

I have followed Rob suggestions on this, i.e. to substute:

(1). *numpy.zeros(X)* instead of *flex.double(X, 0)*
(2). *1000*numpy.ones(X) *instead of *flex.double(X, 1000)*
(3). *numpy.min(X) *for *flex.min(X)*, etc. (mean, sum)
(4). *numpy.random.uniform(size=N)* for *flex.random_double(N) *

However, to get this work, I also had to modify the following:

- modification (4). only works when floats are meant to be used, I guess,
so in the only case: *rnd =
of  *flex.random_double(N)*. In the other two cases it is *random_values =
numpy.random.random_integers(low=0.0, high=1.0, size=N)*  instead of  *
flex.random_double(N)*
- Also,* numpy.nanargmin* instead of *flex.min_index*
- Also, *numpy.argsort* instead of *flex.sort_permutation*
- Also, *.copy()* instead of *.deep_copy()*
- Finally, *numpy.random.seed(0)* instead of *flex.set_random_seed(0)*

Now, it works (at least for the Rosenbrock function).
Thank you,
Andrea

P.S. Sorry, this is the (old) message I referred to:

Hi,
>
> Maybe the following is a useful implementation for you:
> http://cci.lbl.gov/cctbx_sources/scitbx/differential_evolution.py
>
> According to this file you need only the scitbx library, which
> unfortunately looks non-trivial to install (it seems to be related to
> Boost). However, this looks like an old code (stdlib no longer exists,
> you'd just write "import random" now) and all the work done with
> arrays using the scitbx library (index of minimum value, mean value,
> etc.) can easily be done with the much more easily-installed numpy
> library from scipy.org. You probably just need that, a simple graphing
> package such as matplotlib, and a working environment such as Ipython.
> Binary windows installers are available for all these from a simple
> google search for "install X windows" where X is any of the above
> packages (they will be found at sourceforge.net). Don't forget to
> match the binary installer's version to your version of Python.
>
> So instead of importing flex you'd import numpy and then make the
> following substitutions (not tested):
>
> numpy.zeros(X) instead of flex.double(X, 0)
>
> 1000*numpy.ones(X) instead of flex.double(X, 1000)
>
> numpy.min(X) for flex.min(X), etc.
>
> numpy.random.uniform(size=N) for flex.random_double(N)
>
> If you get stuck post your code back here and someone can take a look.
> Hope this helps,
> Rob
>
> On Wed, Feb 24, 2010 at 6:02 PM, Debabrata Midya
> <Debabrata.Midya@services.nsw.gov.au <http://mail.scipy.org/mailman/listinfo/scipy-user>> wrote:
> >* Hi SciPy-Users,*>**>* Thanks in advance.*>**>* I am Deb, Statistician at NSW Department of Services, Technology and*>* Administration, Sydney, Australia.*>**>* I am new to this user group as well as to Python and Parallel Python.*>**>* I am interested to use Differential Evolution (DE) using Parallel Python on*>* Windows XP. I have some experience in DE using GNU GCC compiler.*>**>* Is there any software for it? If yes, anyone can assist me what are the*>* softwares I need to install and their locations please.*>**>* Once again, thank you very much for the time you have given.*>**>* I am looking forward for your reply.*>**>* Regards,*>**>* Deb*>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20121206/1a9643c2/attachment.html
```