scitbx.differential_evolution
index
/net/chevy/raid1/rwgk/dist/cctbx_project/scitbx/differential_evolution.py

 
Modules
       
scitbx.array_family.flex
random

 
Classes
       
__builtin__.object
differential_evolution_optimizer
test_function

 
class differential_evolution_optimizer(__builtin__.object)
    This is a python implementation of differential evolution
It assumes an evaluator class is passed in that has the following
functionality
data members:
 n              :: The number of parameters
 domain         :: a  list [(low,high)]*n
                   with approximate upper and lower limits for each parameter
 x              :: a place holder for a final solution
 
 also a function called 'target' is needed.
 This function should take a parameter vector as input and return a the function to be minimized.
 
 The code below was implemented on the basis of the following sources of information:
 1. http://www.icsi.berkeley.edu/~storn/code.html
 2. http://www.daimi.au.dk/~krink/fec05/articles/JV_ComparativeStudy_CEC04.pdf
 3. http://ocw.mit.edu/NR/rdonlyres/Sloan-School-of-Management/15-099Fall2003/A40397B9-E8FB-4B45-A41B-D1F69218901F/0/ses2_storn_price.pdf
 
 
 The developers of the differential evolution method have this advice:
 (taken from ref. 1)
 
 If you are going to optimize your own objective function with DE,
 try the following settings for the input file first: Choose method
 e.g. DE/rand/1/exp, set the number of parents NP to 10 times the
 number of parameters, select weighting factor F=0.8 and crossover
 constant CR=0.9. Make sure that you initialize your parameter vectors
 by exploiting their full numerical range, i.e. if a parameter is allowed
 to exhibit values in the range [-100, 100] it's a good idea to pick the
 initial values from this range instead of unnecessarily restricting diversity.
 If you experience misconvergence you usually have to increase the value for NP,
 but often you only have to adjust F to be a little lower or higher than 0.8.
 If you increase NP and simultaneously lower F a little, convergence is more likely
 to occur but generally takes longer, i.e. DE is getting more robust (there is always
 a convergence speed/robustness tradeoff).
 
 Note: NP is called population size in the routine below.)
 
  Methods defined here:
__init__(self, evaluator, population_size=50, f=0.80000000000000004, cr=0.90000000000000002, eps=0.01, n_cross=1, max_iter=10000, monitor_cycle=200, out=None, show_progress=False, show_progress_nth_cycle=1, insert_solution_vector=None)
evolve(self)
make_random_population(self)
optimize(self)
score_population(self)
show_population(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class test_function(__builtin__.object)
     Methods defined here:
__init__(self)
target(self, vector)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
run()