Changeset 764


Ignore:
Timestamp:
10/07/14 19:31:21 (20 months ago)
Author:
mmckerns
Message:

fix: ensemble solvers serializable by pp with mild rewrite to local_optimize

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mystic/mystic/ensemble.py

    r762 r764  
    138138        op = [copy(solver) for i in range(len(initial_values))] 
    139139       #cf = [cost for i in range(len(initial_values))] 
    140        #vb = [verbose for i in range(len(initial_values))] 
     140        vb = [verbose for i in range(len(initial_values))] 
     141        cb = [echo for i in range(len(initial_values))] #XXX: remove? 
    141142        id = range(len(initial_values)) 
    142143 
    143144        # generate the local_optimize function 
    144         def local_optimize(solver, x0, rank=None, disp=verbose, callback=echo): 
     145        def local_optimize(solver, x0, rank=None, disp=False, callback=None): 
    145146            solver.id = rank 
    146147            solver.SetInitialPoints(x0) 
     
    153154        # map:: solver = local_optimize(solver, x0, id, verbose) 
    154155        results = self._map(local_optimize, op, initial_values, id, \ 
    155                                                 **self._mapconfig) 
     156                                            vb, cb, **self._mapconfig) 
    156157 
    157158        # save initial state 
     
    296297        op = [copy(solver) for i in range(len(initial_values))] 
    297298       #cf = [cost for i in range(len(initial_values))] 
    298        #vb = [verbose for i in range(len(initial_values))] 
     299        vb = [verbose for i in range(len(initial_values))] 
     300        cb = [echo for i in range(len(initial_values))] #XXX: remove? 
    299301        id = range(len(initial_values)) 
    300302 
    301303        # generate the local_optimize function 
    302         def local_optimize(solver, x0, rank=None, disp=verbose, callback=echo): 
     304        def local_optimize(solver, x0, rank=None, disp=False, callback=None): 
    303305            solver.id = rank 
    304306            solver.SetInitialPoints(x0) 
     
    311313        # map:: solver = local_optimize(solver, x0, id, verbose) 
    312314        results = self._map(local_optimize, op, initial_values, id, \ 
    313                                                 **self._mapconfig) 
     315                                            vb, cb, **self._mapconfig) 
    314316 
    315317        # save initial state 
Note: See TracChangeset for help on using the changeset viewer.