Home | Trees | Indices | Help |
|
---|
|
1 2 # Matthieu Brucher 3 # Last Change : 2007-08-29 15:48 4 5 """ 6 Computes a Newton step for a specific function at a specific point 7 """ 8 9 import numpy 10 import numpy.linalg 1113 """ 14 The Newton step 15 """2717 """ 18 Computes a Newton step based on a function and a point 19 """ 20 hessian = function.hessian(point) 21 gradient = function.gradient(point) 22 step = (-numpy.linalg.solve(hessian, gradient)).reshape(point.shape) 23 state['hessian'] = hessian 24 state['gradient'] = gradient 25 state['direction'] = step 26 return step
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Dec 2 23:44:36 2012 | http://epydoc.sourceforge.net |