source:
releases/mystic-0.1a1-patch2.diff
@
132
Revision 132, 7.4 KB checked in by mmckerns, 7 years ago (diff) |
---|
-
mystic-0.1a1/mystic/scipy_optimize.py
230 230 iterations = 1 231 231 232 232 while (fcalls[0] < self._maxfun and iterations < self._maxiter): 233 StepMonitor(sim , fsim) # getall values; "best" is sim[0]233 StepMonitor(sim[0], fsim[0]) # sim = all values; "best" is sim[0] 234 234 if self._EARLYEXIT or termination(self): 235 235 break 236 236 … … 400 400 iterations = len(stepmon.x) 401 401 allvecs = [] 402 402 for i in range(iterations): 403 #allvecs.append(list(stepmon.x[i] [0]))404 allvecs.append(stepmon.x[i] [0])403 #allvecs.append(list(stepmon.x[i])) 404 allvecs.append(stepmon.x[i]) 405 405 406 406 if fcalls >= solver._maxfun: 407 407 warnflag = 1 -
mystic-0.1a1/examples/example10.py
31 31 # draw the plot 32 32 def plot_frame(label=None): 33 33 pylab.close() 34 pylab. suptitle("8th-order Chebyshev coefficient convergence")34 pylab.title("8th-order Chebyshev coefficient convergence") 35 35 pylab.xlabel("Differential Evolution %s" % label) 36 36 pylab.ylabel("Chi-Squared") 37 37 return -
mystic-0.1a1/examples/example02.py
42 42 pylab.plot([solution[0]],[rosen(solution)],'bo') 43 43 44 44 # draw the plot 45 pylab. suptitle("minimium of Rosenbrock's function")45 pylab.title("minimium of Rosenbrock's function") 46 46 pylab.xlabel("x, y, z") 47 47 pylab.ylabel("f(i) = Rosenbrock's function") 48 48 pylab.legend(["f(x,1,1)","f(1,y,1)","f(1,1,z)"]) -
mystic-0.1a1/examples/example12.py
55 55 # draw the plot 56 56 def plot_frame(label=None): 57 57 pylab.close() 58 pylab. suptitle("fitting noisy 5th-order polynomial coefficients")58 pylab.title("fitting noisy 5th-order polynomial coefficients") 59 59 pylab.xlabel("x") 60 60 pylab.ylabel("f(x)") 61 61 return -
mystic-0.1a1/examples/example04.py
25 25 26 26 # draw the plot 27 27 def plot_frame(): 28 pylab. suptitle("Rosenbrock parameter convergence")28 pylab.title("Rosenbrock parameter convergence") 29 29 pylab.xlabel("Nelder-Mead solver iterations") 30 30 pylab.ylabel("parameter value") 31 31 return -
mystic-0.1a1/examples/example06.py
24 24 25 25 # draw the plot 26 26 def plot_exact(): 27 pylab. suptitle("fitting 8th-order Chebyshev polynomial coefficients")27 pylab.title("fitting 8th-order Chebyshev polynomial coefficients") 28 28 pylab.xlabel("x") 29 29 pylab.ylabel("f(x)") 30 30 import numpy -
mystic-0.1a1/examples/example08.py
30 30 31 31 # draw the plot 32 32 def plot_exact(): 33 pylab. suptitle("fitting 8th-order Chebyshev polynomial coefficients")33 pylab.title("fitting 8th-order Chebyshev polynomial coefficients") 34 34 pylab.xlabel("x") 35 35 pylab.ylabel("f(x)") 36 36 import numpy -
mystic-0.1a1/examples/example11.py
31 31 # draw the plot 32 32 def plot_frame(label=None): 33 33 pylab.close() 34 pylab. suptitle("8th-order Chebyshev coefficient convergence")34 pylab.title("8th-order Chebyshev coefficient convergence") 35 35 pylab.xlabel("Nelder-Mead Simplex Solver %s" % label) 36 36 pylab.ylabel("Chi-Squared") 37 37 return … … 39 39 # plot the polynomial trajectories 40 40 def plot_params(monitor): 41 41 x = range(len(monitor.y)) 42 import numpy 43 # NOTE: workaround poor design, where simplex is logged by StepMonitor 44 if isinstance(monitor.y[0],numpy.ndarray): 45 y = [i[0] for i in monitor.y] 46 else: 47 y = monitor.y 42 y = monitor.y 48 43 pylab.plot(x,y,'b-') 49 44 pylab.axis([1,0.5*x[-1],0,y[1]],'k-') 50 45 return 51 46 52 47 # draw the plot 53 48 def plot_exact(): 54 pylab. suptitle("fitting 8th-order Chebyshev polynomial coefficients")49 pylab.title("fitting 8th-order Chebyshev polynomial coefficients") 55 50 pylab.xlabel("x") 56 51 pylab.ylabel("f(x)") 57 52 import numpy -
mystic-0.1a1/examples/example03.py
36 36 pylab.plot([i[2] for i in allvecs]) 37 37 38 38 # draw the plot 39 pylab. suptitle("Rosenbrock parameter convergence")39 pylab.title("Rosenbrock parameter convergence") 40 40 pylab.xlabel("Nelder-Mead solver iterations") 41 41 pylab.ylabel("parameter value") 42 42 pylab.legend(["x", "y", "z"]) -
mystic-0.1a1/examples/example07.py
25 25 26 26 # draw the plot 27 27 def plot_exact(): 28 pylab. suptitle("fitting 8th-order Chebyshev polynomial coefficients")28 pylab.title("fitting 8th-order Chebyshev polynomial coefficients") 29 29 pylab.xlabel("x") 30 30 pylab.ylabel("f(x)") 31 31 import numpy -
mystic-0.1a1/examples/example09.py
32 32 33 33 # draw the plot 34 34 def plot_exact(): 35 pylab. suptitle("fitting 8th-order Chebyshev polynomial coefficients")35 pylab.title("fitting 8th-order Chebyshev polynomial coefficients") 36 36 pylab.xlabel("x") 37 37 pylab.ylabel("f(x)") 38 38 import numpy -
mystic-0.1a1/examples/README
1 1 == Notes on mystic examples == 2 NOTE: for all examples that use matplotlib, please use the TKAgg backend. 3 Thus, run the examples like this: "python example04.py -dTKAgg" 4 (see ticket #36 for more details). 2 5 3 6 Dependencies: 4 - All examples with prefix "example" should run without new dependencies, and are intended as a tutorial . (i.e. TRY THESE FIRST)7 - All examples with prefix "example" should run without new dependencies, and are intended as a tutorial (i.e. TRY THESE FIRST). 5 8 - All examples with prefix "test_" should run without new dependencies. 6 9 - All examples with prefix "gplot_" requres gnuplot-py to be installed. 7 10
Note: See TracBrowser
for help on using the repository browser.