new gradient handling way nicer

This commit is contained in:
Max Zwiessele 2014-01-24 15:07:28 +00:00
parent f0ac290eb3
commit e128059377
6 changed files with 15 additions and 26 deletions

View file

@ -26,9 +26,6 @@ class Param(ObservableArray, Constrainable):
:param name: name of the parameter to be printed
:param input_array: array which this parameter handles
:param gradient: callable with one argument, which is the model of this parameter
:param args: additional arguments to gradient
:param kwargs: additional keyword arguments to gradient
You can add/remove constraints by calling constrain on the parameter itself, e.g:
@ -156,6 +153,8 @@ class Param(ObservableArray, Constrainable):
@property
def _parameters_(self):
return []
def _collect_gradient(self, target):
target[:] = self.gradient
#===========================================================================
# Fixing Parameters:
#===========================================================================