mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 19:42:39 +02:00
new gradient handling way nicer
This commit is contained in:
parent
f0ac290eb3
commit
e128059377
6 changed files with 15 additions and 26 deletions
|
|
@ -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:
|
||||
#===========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue