Package mystic :: Module abstract_nested_solver :: Class AbstractNestedSolver

Class AbstractNestedSolver

source code


AbstractNestedSolver base class for mystic optimizers that are nested within a parallel map. This allows pseudo-global coverage of parameter space using non-global optimizers.

Instance Methods
 
__init__(self, dim, **kwds)
Takes one initial input: dim -- dimensionality of the problem.
source code
 
SetNestedSolver(self, solver)
set the nested solver
source code
 
SetInitialPoints(self, x0, radius=0.05)
Set Initial Points with Guess (x0)
source code
 
SetRandomInitialPoints(self, min=None, max=None)
Generate Random Initial Points within given Bounds
source code
 
SetMultinormalInitialPoints(self, mean, var=None)
Generate Initial Points from Multivariate Normal.
source code

Inherited from abstract_map_solver.AbstractMapSolver: SelectQueue, SelectServers, SetLauncher, SetMapper

Inherited from abstract_solver.AbstractSolver: SetEvaluationLimits, SetStrictRanges, Solution, Solve, disable_signal_handler, enable_signal_handler

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, dim, **kwds)
(Constructor)

source code 

Takes one initial input:
    dim      -- dimensionality of the problem.

Additional inputs:
    npop     -- size of the trial solution population.      [default = 1]
    nbins    -- tuple of number of bins in each dimension.  [default = [1]*dim]
    npts     -- number of solver instances.                 [default = 1]

Important class members:
    nDim, nPop     = dim, npop
    generations    - an iteration counter.
    bestEnergy     - current best energy.
    bestSolution   - current best parameter set.            [size = dim]
    popEnergy      - set of all trial energy solutions.     [size = npop]
    population     - set of all trial parameter solutions.  [size = dim*npop]
    energy_history - history of bestEnergy status.          [equivalent to StepMonitor]
    signal_handler - catches the interrupt signal.          [***disabled***]
        

Overrides: object.__init__

SetNestedSolver(self, solver)

source code 

set the nested solver

input:

   - solver: a mystic solver class (e.g. NelderMeadSimplexSolver)

SetInitialPoints(self, x0, radius=0.05)

source code 

Set Initial Points with Guess (x0)

input:

   - x0: must be a sequence of length self.nDim
   - radius: generate random points within [-radius*x0, radius*x0]
       for i!=0 when a simplex-type initial guess in required

*** this method must be overwritten ***

Overrides: abstract_solver.AbstractSolver.SetInitialPoints

SetRandomInitialPoints(self, min=None, max=None)

source code 

Generate Random Initial Points within given Bounds

input:

   - min, max: must be a sequence of length self.nDim
   - each min[i] should be <= the corresponding max[i]

*** this method must be overwritten ***

Overrides: abstract_solver.AbstractSolver.SetRandomInitialPoints

SetMultinormalInitialPoints(self, mean, var=None)

source code 

Generate Initial Points from Multivariate Normal.

input:

   - mean must be a sequence of length self.nDim
   - var can be...
       None: -> it becomes the identity
       scalar: -> var becomes scalar * I
       matrix: -> the variance matrix. must be the right size!

*** this method must be overwritten ***

Overrides: abstract_solver.AbstractSolver.SetMultinormalInitialPoints