Changeset 82 for tests/sam_rosenbrock.py


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/sam_rosenbrock.py

    r81 r82  
    1212import sam 
    1313from test_rosenbrock import * 
    14 from mystic.nelder_mead import fmin, Sow 
    15 from mystic import getch 
     14from mystic.scipy_optimize_fmin import NelderMeadSimplexSolver as fmin 
     15from mystic.nmtools import IterationRelativeError as IRE 
     16from mystic import getch, Sow 
    1617 
    1718def draw_contour(): 
     
    4041def run_once(x0,x1): 
    4142    simplex = Sow() 
    42     sol = fmin(rosen, [x0, x1], retall = True, StepMonitor = simplex) 
     43    xinit = [x0, x1] 
     44 
     45    solver = fmin(len(xinit)) 
     46    solver.SetInitialPoints(xinit) 
     47    killme = IRE(1e-4,1e-4) 
     48    solver.Solve(rosen, termination=killme, StepMonitor = simplex) 
     49    sol = solver.Solution() 
    4350     
    4451    for x in simplex.x: 
Note: See TracChangeset for help on using the changeset viewer.