Changes between Version 2 and Version 3 of DevelopmentIdeas/ModularOptimization
- Timestamp:
- 04/14/07 14:16:23 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevelopmentIdeas/ModularOptimization
v2 v3 1 1 = Modular Optimization and Root Finding = 2 This page contains discussions about a modularized optimization and root finding package. 2 This page contains discussions about a modularized optimization and root finding package. Please make copious changes and add lots of comments and discussions. We should refactor once it becomes large. Once ideas are clearly formed, they should be posted to the !SciPy-dev mailing list for comments and suggestions. 3 3 4 [[PageOutline(5,Contents,inline)]] (Why does this macro not work to generate the table of contents?) 5 6 == Module Structure == 7 For now I am putting everything in an `moptimize` module for "Modular Optimization". Hopefully this will be able to replace the scipy.optimize module at somepoint. Note that coding standards, etc. can be found at the following sites: 8 * [http://www.python.org/dev/peps/pep-0008/ PEP 8] -- Generic python coding standards. 9 * TestingGuidelines -- !NumPy/!SciPy testing guidelines. 10 * [http://www.scipy.org/DocstringStandard SciPy/DocstringStandard] -- !NumPy/!SciPy docstring standards. 11 12 {{{ 13 moptimize 14 |-- __init__.py : Initialization of package (each subdir should have one) 15 | 16 |-- tests : Testing (each subdir should have one.) 17 | 18 |-- function : Function wrappers, jacobian computations etc. 19 | 20 |-- methods : General optimization methods 21 | 22 ... 23 }}} 4 24 == Interface == 5 25 There should be a very simple interface with default options and methods specified to get code working. One should then be able to refine the method to suit the particular problem. Ultimately, it might be nice to provide tools that could try different methods and parameter values to determine the "optimum" solver for a given problem. … … 8 28 {{{ 9 29 #!python 10 from optimize import Zeros30 from moptimize import Zeros 11 31 12 32 def f(x,n): … … 23 43 {{{ 24 44 #!python 25 from optimize.methods import Broyden26 from optimize import Zeros45 from moptimize.methods import Broyden 46 from moptimize import Zeros 27 47 ... 28 48 method = Broyden(ftol=1e-10,xtol=1e-12) … … 32 52 {{{ 33 53 #!python 34 from optimize.method import Broyden35 from optimize.method.criteria import RelativeValueCriterion54 from moptimize.method import Broyden 55 from moptimize.method.criteria import RelativeValueCriterion 36 56 37 57 class MyMethod(Broyden): … … 43 63 {{{ 44 64 #!python 45 from optimize.method import Broyden46 from optimize.method.criteria import RelativeValueCriterion65 from moptimize.method import Broyden 66 from moptimize.method.criteria import RelativeValueCriterion 47 67 method = Broyden(criterion=RelativeValueCriterion()) 48 68 }}} … … 57 77 It would be nice if the calling conventions for each method were as compatible as possible so that it is easy to swap different methods in an out. 58 78 ==== Arguments ==== 59 `f` or `func`::60 Every driver routine will need to specify a function. Should this argument be called `f` or `func`. In !SciPy, both are used about the same amount. (P.S. Why does the definition list Wiki syntax work here?)61 `x0`::79 `f` or `func`:: 80 Every driver routine will need to specify a function. Should this argument be called `f` or `func`. In !SciPy, both are used about the same amount. 81 `x0`:: 62 82 When an initial argument is supplied, the convention seems to be to use `x0`. 63 `ftol`, `xtol`, etc.::83 `ftol`, `xtol`, etc.:: 64 84 These seem to be the convention for specifying tolerances. The only problem I have with this is that I would like the option of specifying both absolute and relative tolerances. Perhaps something like `xtol` and `xtol_rel` could be used (absolute tolerances are usually easier to deal with in general). 65 85
