mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-10 20:42:39 +02:00
self.num_data and self.input_dim are set dynamically in class GP() after the shape of X. In MRD, the user-specific values are passed around until X is defined.
This commit is contained in:
parent
1e06c6ce2f
commit
7871af8dec
2 changed files with 18 additions and 17 deletions
|
|
@ -43,8 +43,6 @@ class GP(Model):
|
|||
self.X = X.copy()
|
||||
else: self.X = ObsAr(X)
|
||||
|
||||
self.num_data, self.input_dim = self.X.shape
|
||||
|
||||
assert Y.ndim == 2
|
||||
logger.info("initializing Y")
|
||||
|
||||
|
|
@ -199,6 +197,14 @@ class GP(Model):
|
|||
def _predictive_variable(self):
|
||||
return self.X
|
||||
|
||||
@property
|
||||
def num_data(self):
|
||||
return self.X.shape[0]
|
||||
|
||||
@property
|
||||
def input_dim(self):
|
||||
return self.X.shape[1]
|
||||
|
||||
def set_XY(self, X=None, Y=None):
|
||||
"""
|
||||
Set the input / output data of the model
|
||||
|
|
@ -236,7 +242,6 @@ class GP(Model):
|
|||
else:
|
||||
self.X = ObsAr(X)
|
||||
|
||||
self.num_data, self.input_dim = self.X.shape
|
||||
self.update_model(True)
|
||||
|
||||
def set_X(self,X):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue