Changeset 82 for tests/sam_zimmermann.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_zimmermann.py

    r81 r82  
    1212import sam 
    1313from test_zimmermann import * 
    14 from mystic.nelder_mead import fmin 
     14from mystic.scipy_optimize_fmin import NelderMeadSimplexSolver as fmin 
     15from mystic.nmtools import IterationRelativeError as IRE 
    1516from mystic import getch, Sow 
    1617 
     
    3940def run_once(): 
    4041    simplex = Sow() 
    41     sol = fmin(CostFunction, [random.uniform(0,7), random.uniform(0,7)], retall = True, StepMonitor = simplex) 
    42      
     42    solver = fmin(2) 
     43    solver.SetRandomInitialPoints([0,0],[7,7]) 
     44    killme = IRE(1e-4,1e-4) 
     45    solver.Solve(CostFunction, termination=killme, StepMonitor = simplex) 
     46    sol = solver.Solution() 
     47 
    4348    for x in simplex.x: 
    4449        sam.putarray('x',x) 
Note: See TracChangeset for help on using the changeset viewer.