mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-07 19:12:40 +02:00
Just had to do a check in from midlantic (showing off).
This commit is contained in:
parent
483cb7ddc0
commit
ed2fa6c0bd
3 changed files with 122 additions and 84 deletions
|
|
@ -13,14 +13,14 @@ class Symbolic(Mapping, Symbolic_core):
|
|||
Mapping where the form of the mapping is provided by a sympy expression.
|
||||
|
||||
"""
|
||||
def __init__(self, input_dim, output_dim, f=None, name='symbolic', param=None, func_modules=[]):
|
||||
def __init__(self, input_dim, output_dim, f=None, name='symbolic', parameters=None, func_modules=[]):
|
||||
|
||||
|
||||
if f is None:
|
||||
raise ValueError, "You must provide an argument for the function."
|
||||
|
||||
Mapping.__init__(self, input_dim, output_dim, name=name)
|
||||
Symbolic_core.__init__(self, f, ['X'], derivatives = ['X', 'theta'], param=param, func_modules=func_modules)
|
||||
Symbolic_core.__init__(self, {'f': f}, ['X'], derivatives = ['X', 'theta'], parameters=parameters, func_modules=func_modules)
|
||||
|
||||
self._initialize_cache()
|
||||
self.parameters_changed()
|
||||
|
|
@ -32,19 +32,19 @@ class Symbolic(Mapping, Symbolic_core):
|
|||
def parameters_changed(self):
|
||||
self.eval_parameters_changed()
|
||||
|
||||
def update_cache(self, X):
|
||||
self.eval_update_cache(X)
|
||||
def update_cache(self, X=None):
|
||||
self.eval_update_cache(X=X)
|
||||
|
||||
def update_gradients(self, partial, X):
|
||||
self.eval_update_gradients(partial, X)
|
||||
def update_gradients(self, partial, X=None):
|
||||
self.eval_update_gradients('f', partial, X=X)
|
||||
|
||||
def gradients_X(self, partial, X):
|
||||
return self.eval_gradients_X(partial, X)
|
||||
def gradients_X(self, partial, X=None):
|
||||
return self.eval_gradients_X('f', partial, X=X)
|
||||
|
||||
def f(self, X):
|
||||
def f(self, X=None):
|
||||
"""
|
||||
"""
|
||||
return self.eval_f(X)
|
||||
return self.eval_function('f', X=X)
|
||||
|
||||
|
||||
def df_dX(self, X):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue