Ignore:
Timestamp:
01/26/09 16:12:08 (7 years ago)
Author:
mmckerns
Message:

scipy.optimize.fmin fit to mystic.Solve interface;
mystic handlers, etc added to fmin solver;
VerboseSow? edited to handle simplex-type cloud of results per iteration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/test_zimmermann.py

    r81 r82  
    6363 
    6464    from mystic import Sow 
    65     from mystic.nelder_mead import fmin 
     65    from mystic.scipy_optimize_fmin import NelderMeadSimplexSolver as fmin 
     66    from mystic.nmtools import IterationRelativeError as IRE 
    6667 
    6768    simplex = Sow() 
    6869    esow = Sow() 
    69     sol = fmin(CostFunction, [random.uniform(0,5) for j in range(ND)], EvaluationMonitor = esow, retall = True, StepMonitor = simplex) 
    70     #print "solution: ", sol 
     70    xinit = [random.uniform(0,5) for j in range(ND)] 
     71 
     72    solver = fmin(len(xinit)) 
     73    solver.SetInitialPoints(xinit) 
     74    killme = IRE(1e-4,1e-4) 
     75    solver.Solve(CostFunction, killme, EvaluationMonitor = esow, StepMonitor = simplex) 
     76    sol = solver.Solution() 
     77    print "solution: ", sol 
    7178 
    7279# end of file 
Note: See TracChangeset for help on using the changeset viewer.