Package PyDSTool :: Package Toolbox :: Package optimizers :: Package step :: Module gradient_step
[hide private]
[frames] | no frames]

Source Code for Module PyDSTool.Toolbox.optimizers.step.gradient_step

 1   
 2  # Matthieu Brucher 
 3  # Last Change : 2007-08-10 23:15 
 4   
 5  """ 
 6  Computes a gradient step for a specific function at a specific point 
 7  """ 
 8   
9 -class GradientStep(object):
10 """ 11 The simple gradient step 12 """
13 - def __call__(self, function, point, state):
14 """ 15 Computes a gradient step based on a function and a point 16 """ 17 gradient = function.gradient(point) 18 state['gradient'] = gradient 19 step = - gradient 20 state['direction'] = step 21 return step
22