Changeset 172
- Timestamp:
- 08/07/09 11:28:29 (7 years ago)
- Location:
- branches/UQ
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UQ/MPITEST.py
r157 r172 23 23 from pyina.differential_evolution import DifferentialEvolutionSolver2 24 24 from pyina.parallel_map2 import parallel_map 25 from mystic.termination import VTR25 from mystic.termination import CandidateRelativeTolerance as CRT 26 26 from mystic.strategy import Best1Exp 27 27 from mystic import getch, random_seed, VerboseSow, Sow … … 29 29 random_seed(123) 30 30 31 stepmon = VerboseSow() 31 #stepmon = VerboseSow(100) 32 stepmon = Sow() 32 33 evalmon = Sow() 33 34 … … 40 41 solver.SetEvaluationLimits(maxiter,maxfun) 41 42 42 solver.Solve(cost,termination=VTR(convergence_tol),strategy=Best1Exp, \ 43 tol = convergence_tol 44 solver.Solve(cost,termination=CRT(tol,tol),strategy=Best1Exp, \ 43 45 CrossProbability=crossover,ScalingFactor=percent_change, \ 44 46 StepMonitor=stepmon, EvaluationMonitor=evalmon) 45 47 48 #print solver.Solution() 46 49 diameter = -solver.bestEnergy / scale 47 50 func_evals = len(evalmon.y) … … 105 108 print " model: f(t) = x1*x2 + x3 + 2.0" 106 109 print " parameters: ['x1', 'x2', 'x3']" 110 #print " lower bounds: %s" % lower_bounds 111 #print " upper bounds: %s" % upper_bounds 107 112 print " ..." 108 113 -
branches/UQ/TEST.py
r157 r172 9 9 #XXX: <mpi config goes here> 10 10 11 npop = 100 12 maxiter = 2 #XXX: maxiter too small? 13 maxfun = 10 #XXX: maxfun too small? 14 convergence_tol = 0.05 15 crossover = 0.5 16 percent_change = 1.0 #XXX: is 0.9 better? 17 11 npop = 20 12 maxiter = 500 13 maxfun = 1e+6 14 convergence_tol = 1e-4 15 crossover = 0.9 16 percent_change = 0.9 18 17 19 18 ####################################################################### … … 28 27 def model(t): 29 28 """a simple time-dependent model function 30 f(t) = x1*x2 + x3 + 2.0 [yes, it's actually time-independent...]29 f(t) = x1*x2 + x3 + 2.0 31 30 32 31 Input: … … 84 83 def dakota(cost,lb,ub): 85 84 from mystic.differential_evolution import DifferentialEvolutionSolver2 86 from mystic.termination import VTR85 from mystic.termination import CandidateRelativeTolerance as CRT 87 86 from mystic.strategy import Best1Exp 88 87 from mystic import getch, random_seed, VerboseSow, Sow … … 90 89 random_seed(123) 91 90 92 stepmon = VerboseSow() 91 #stepmon = VerboseSow(100) 92 stepmon = Sow() 93 93 evalmon = Sow() 94 94 … … 100 100 solver.SetEvaluationLimits(maxiter,maxfun) 101 101 102 solver.Solve(cost,termination=VTR(convergence_tol),strategy=Best1Exp, \ 102 tol = convergence_tol 103 solver.Solve(cost,termination=CRT(tol,tol),strategy=Best1Exp, \ 103 104 CrossProbability=crossover,ScalingFactor=percent_change, \ 104 105 StepMonitor=stepmon, EvaluationMonitor=evalmon) 105 106 107 print solver.Solution() 106 108 diameter = -solver.bestEnergy / scale 107 109 func_evals = len(evalmon.y) … … 152 154 print " model: f(t) = x1*x2 + x3 + 2.0" 153 155 print " parameters: ['x1', 'x2', 'x3']" 156 print " lower bounds: %s" % lower_bounds 157 print " upper bounds: %s" % upper_bounds 154 158 print " ..." 155 159 -
branches/UQ/TEST2.py
r157 r172 9 9 #XXX: <mpi config goes here> 10 10 11 npop = 50012 maxiter = 513 maxfun = 500014 convergence_tol = 0.00115 crossover = 0. 116 percent_change = 0. 511 npop = 20 12 maxiter = 1000 13 maxfun = 1e+6 14 convergence_tol = 1e-4 15 crossover = 0.9 16 percent_change = 0.9 17 17 18 18 … … 84 84 def dakota(cost,lb,ub): 85 85 from mystic.differential_evolution import DifferentialEvolutionSolver2 86 from mystic.termination import VTR86 from mystic.termination import CandidateRelativeTolerance as CRT 87 87 from mystic.strategy import Best1Exp 88 88 from mystic import getch, random_seed, VerboseSow, Sow … … 90 90 random_seed(123) 91 91 92 stepmon = VerboseSow() 92 #stepmon = VerboseSow(100) 93 stepmon = Sow() 93 94 evalmon = Sow() 94 95 … … 100 101 solver.SetEvaluationLimits(maxiter,maxfun) 101 102 102 solver.Solve(cost,termination=VTR(convergence_tol),strategy=Best1Exp, \ 103 tol = convergence_tol 104 solver.Solve(cost,termination=CRT(tol,tol),strategy=Best1Exp, \ 103 105 CrossProbability=crossover,ScalingFactor=percent_change, \ 104 106 StepMonitor=stepmon, EvaluationMonitor=evalmon)
Note: See TracChangeset
for help on using the changeset viewer.