/[escript]/trunk/downunder/py_src/minimizers.py
ViewVC logotype

Diff of /trunk/downunder/py_src/minimizers.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3946 by caltinay, Wed Aug 22 02:08:12 2012 UTC revision 3947 by caltinay, Wed Aug 22 23:19:10 2012 UTC
# Line 19  __license__="""Licensed under the Open S Line 19  __license__="""Licensed under the Open S
19  http://www.opensource.org/licenses/osl-3.0.php"""  http://www.opensource.org/licenses/osl-3.0.php"""
20  __url__="https://launchpad.net/escript-finley"  __url__="https://launchpad.net/escript-finley"
21    
22    __all__ = ['AbstractMinimizer', 'MinimizerLBFGS', 'MinimizerBFGS', 'MinimizerNLCG']
23    
24  import logging  import logging
25  import numpy as np  import numpy as np
26  try:  try:
# Line 28  except: Line 30  except:
30      sqrt=np.sqrt      sqrt=np.sqrt
31      EPSILON=1e-18      EPSILON=1e-18
32    
   
33  lslogger=logging.getLogger('inv.minimizer.linesearch')  lslogger=logging.getLogger('inv.minimizer.linesearch')
34  zoomlogger=logging.getLogger('inv.minimizer.linesearch.zoom')  zoomlogger=logging.getLogger('inv.minimizer.linesearch.zoom')
35    
# Line 429  class MinimizerNLCG(AbstractMinimizer): Line 430  class MinimizerNLCG(AbstractMinimizer):
430  if __name__=="__main__":  if __name__=="__main__":
431      # Example usage with function 'rosen' (minimum=[1,1,...1]):      # Example usage with function 'rosen' (minimum=[1,1,...1]):
432      from scipy.optimize import rosen, rosen_der      from scipy.optimize import rosen, rosen_der
433      from costfunctions import CostFunction      from esys.downunder.costfunctions import CostFunction
434      import sys      import sys
435      N=100      N=100
436      x0=np.array([4.]*N) # initial guess      x0=np.array([4.]*N) # initial guess

Legend:
Removed from v.3946  
changed lines
  Added in v.3947

  ViewVC Help
Powered by ViewVC 1.1.26