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_rosenbrock.py

    r5 r82  
    1313from mystic.differential_evolution import DifferentialEvolutionSolver 
    1414from mystic.detools import Best1Exp, Rand1Exp, Best2Bin, ChangeOverGeneration, VTR 
    15 from mystic.nelder_mead import fmin, rosen 
     15from mystic.scipy_optimize_fmin import __rosen as rosen 
     16from mystic.scipy_optimize_fmin import NelderMeadSimplexSolver as fmin 
     17from mystic.nmtools import IterationRelativeError as IRE 
    1618from mystic import Sow 
    1719 
     
    4547    esow= Sow() 
    4648    ssow= Sow() 
    47     sol = fmin(rosen, [random.random() for j in range(ND)], full_output=1, retall=1, EvaluationMonitor=esow, SimplexMonitor=ssow) 
    48     print sol[0] 
     49    xinit = [random.random() for j in range(ND)] 
     50 
     51    solver = fmin(len(xinit)) 
     52    solver.SetInitialPoints(xinit) 
     53    killme = IRE(1e-4,1e-4) 
     54    solver.Solve(rosen, killme, EvaluationMonitor = esow, StepMonitor = ssow) 
     55    sol = solver.Solution() 
     56    print sol 
    4957  
    5058    print len(esow.x) 
Note: See TracChangeset for help on using the changeset viewer.