Changeset 82 for tests/sam_corana2.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_corana2.py

    r81 r82  
    1111import sam 
    1212from test_corana import * 
    13 from mystic.nelder_mead import fmin, Sow 
    14 from mystic import getch 
     13from mystic.scipy_optimize_fmin import NelderMeadSimplexSolver as fmin 
     14from mystic.nmtools import IterationRelativeError as IRE 
     15from mystic import getch, Sow 
    1516 
    1617def Corana2(x): 
     
    4243def run_once(): 
    4344    simplex = Sow() 
    44     sol = fmin(Corana2, [random.uniform(0,2), random.uniform(0,2)], retall = True, StepMonitor = simplex) 
     45    solver = fmin(2) 
     46    solver.SetRandomInitialPoints([0,0],[2,2]) 
     47    killme = IRE(1e-4,1e-4) 
     48    solver.Solve(Corana2, termination=killme, StepMonitor = simplex) 
     49    sol = solver.Solution() 
    4550     
    4651    for x in simplex.x: 
Note: See TracChangeset for help on using the changeset viewer.