Changeset 83
- Timestamp:
- 01/26/09 16:54:02 (7 years ago)
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
python/detools.py
r77 r83 24 24 25 25 def ChangeOverGeneration(tolerance = 1e-6, generations = 30): 26 def _(hist): 26 def _(inst): 27 hist = inst.energy_history 27 28 lg = len(hist) 28 29 return lg > generations and (hist[-generations]-hist[-1]) < tolerance … … 30 31 31 32 def VTR(tolerance = 0.005): 32 def _(hist): 33 def _(inst): 34 hist = inst.energy_history 33 35 return hist[-1] < tolerance 34 36 return _ -
python/differential_evolution.py
r77 r83 228 228 self.energy_history.append(self.bestEnergy) 229 229 230 if detools.EARLYEXIT or termination(self .energy_history):230 if detools.EARLYEXIT or termination(self): 231 231 break 232 232 … … 323 323 self.energy_history.append(self.bestEnergy) 324 324 325 if detools.EARLYEXIT or termination(self .energy_history):325 if detools.EARLYEXIT or termination(self): 326 326 break 327 327 -
tests/sam_corana2.py
r82 r83 45 45 solver = fmin(2) 46 46 solver.SetRandomInitialPoints([0,0],[2,2]) 47 killme = IRE(1e-4,1e-4) 48 solver.Solve(Corana2, termination=killme, StepMonitor = simplex) 47 solver.Solve(Corana2, termination=IRE(), StepMonitor = simplex) 49 48 sol = solver.Solution() 50 49 -
tests/sam_mogi.py
r82 r83 66 66 solver = fmin(len(xinit)) 67 67 solver.SetInitialPoints(xinit) 68 killme = IRE(1e-4,1e-4) 69 solver.Solve(cost_function, termination=killme, StepMonitor = simplex) 68 solver.Solve(cost_function, termination=IRE() StepMonitor = simplex) 70 69 sol = solver.Solution() 71 70 print sol … … 85 84 solver = fmin(len(xinit)) 86 85 solver.SetInitialPoints(xinit) 87 killme = IRE(1e-4,1e-4) 88 solver.Solve(cost_function, termination=killme, StepMonitor = simplex) 86 solver.Solve(cost_function, termination=IRE(), StepMonitor = simplex) 89 87 sol = solver.Solution() 90 88 print sol -
tests/sam_rosenbrock.py
r82 r83 45 45 solver = fmin(len(xinit)) 46 46 solver.SetInitialPoints(xinit) 47 killme = IRE(1e-4,1e-4) 48 solver.Solve(rosen, termination=killme, StepMonitor = simplex) 47 solver.Solve(rosen, termination=IRE(), StepMonitor = simplex) 49 48 sol = solver.Solution() 50 49 -
tests/sam_zimmermann.py
r82 r83 42 42 solver = fmin(2) 43 43 solver.SetRandomInitialPoints([0,0],[7,7]) 44 killme = IRE(1e-4,1e-4) 45 solver.Solve(CostFunction, termination=killme, StepMonitor = simplex) 44 solver.Solve(CostFunction, termination=IRE(), StepMonitor = simplex) 46 45 sol = solver.Solution() 47 46 -
tests/test_mogi.py
r82 r83 128 128 solver = fmin(len(point)) 129 129 solver.SetInitialPoints(point) 130 killme = IRE(1e-4,1e-4) 131 solver.Solve(cost_function, killme, EvaluationMonitor = esow, StepMonitor = simplex) 130 solver.Solve(cost_function, IRE(), EvaluationMonitor = esow, StepMonitor = simplex) 132 131 sol = solver.Solution() 133 132 -
tests/test_rosenbrock.py
r82 r83 51 51 solver = fmin(len(xinit)) 52 52 solver.SetInitialPoints(xinit) 53 killme = IRE(1e-4,1e-4) 54 solver.Solve(rosen, killme, EvaluationMonitor = esow, StepMonitor = ssow) 53 solver.Solve(rosen, IRE(), EvaluationMonitor = esow, StepMonitor = ssow) 55 54 sol = solver.Solution() 56 55 print sol -
tests/test_zimmermann.py
r82 r83 72 72 solver = fmin(len(xinit)) 73 73 solver.SetInitialPoints(xinit) 74 killme = IRE(1e-4,1e-4) 75 solver.Solve(CostFunction, killme, EvaluationMonitor = esow, StepMonitor = simplex) 74 solver.Solve(CostFunction, IRE(), EvaluationMonitor = esow, StepMonitor = simplex) 76 75 sol = solver.Solution() 77 76 print "solution: ", sol
Note: See TracChangeset
for help on using the changeset viewer.