mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-08 15:05:15 +02:00
Fixing W_columns and num_outputs nomenclature
This commit is contained in:
parent
c800e0687f
commit
0ae9f9aafd
4 changed files with 36 additions and 21 deletions
|
|
@ -128,10 +128,9 @@ class GPBase(Model):
|
|||
else:
|
||||
raise NotImplementedError, "Cannot define a frame with more than two input dimensions"
|
||||
else:
|
||||
assert self.num_outputs > output, 'The model has only %s outputs.' %self.num_outputs
|
||||
assert len(self.likelihood.noise_model_list) > output, 'The model has only %s outputs.' %self.num_outputs
|
||||
|
||||
if self.X.shape[1] == 2:
|
||||
assert self.num_outputs >= output, 'The model has only %s outputs.' %self.num_outputs
|
||||
Xu = self.X[self.X[:,-1]==output ,0:1]
|
||||
Xnew, xmin, xmax = x_frame1D(Xu, plot_limits=plot_limits)
|
||||
|
||||
|
|
@ -263,7 +262,7 @@ class GPBase(Model):
|
|||
raise NotImplementedError, "Cannot define a frame with more than two input dimensions"
|
||||
|
||||
else:
|
||||
assert self.num_outputs > output, 'The model has only %s outputs.' %self.num_outputs
|
||||
assert len(self.likelihood.noise_model_list) > output, 'The model has only %s outputs.' %self.num_outputs
|
||||
if self.X.shape[1] == 2:
|
||||
resolution = resolution or 200
|
||||
Xu = self.X[self.X[:,-1]==output,:] #keep the output of interest
|
||||
|
|
@ -287,3 +286,20 @@ class GPBase(Model):
|
|||
|
||||
else:
|
||||
raise NotImplementedError, "Cannot define a frame with more than two input dimensions"
|
||||
|
||||
"""
|
||||
def samples_f(self,X,samples=10, which_data='all', which_parts='all',output=None):
|
||||
if which_data == 'all':
|
||||
which_data = slice(None)
|
||||
|
||||
if hasattr(self,'multioutput'):
|
||||
np.hstack([X,np.ones((X.shape[0],1))*output])
|
||||
|
||||
m, v = self._raw_predict(X, which_parts=which_parts, full_cov=True)
|
||||
v = v.reshape(m.size,-1) if len(v.shape)==3 else v
|
||||
Ysim = np.random.multivariate_normal(m.flatten(), v, samples)
|
||||
#gpplot(X, m, m - 2 * np.sqrt(np.diag(v)[:, None]), m + 2 * np.sqrt(np.diag(v))[:, None, ], axes=ax)
|
||||
for i in range(samples):
|
||||
ax.plot(X, Ysim[i, :], Tango.colorsHex['darkBlue'], linewidth=0.25)
|
||||
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -367,9 +367,8 @@ class SparseGP(GPBase):
|
|||
ax.plot(Zu[:, 0], Zu[:, 1], 'wo')
|
||||
|
||||
else:
|
||||
pass
|
||||
"""
|
||||
if self.X.shape[1] == 2 and hasattr(self,'multioutput'):
|
||||
"""
|
||||
Xu = self.X[self.X[:,-1]==output,:]
|
||||
if self.has_uncertain_inputs:
|
||||
Xu = self.X * self._Xscale + self._Xoffset # NOTE self.X are the normalized values now
|
||||
|
|
@ -380,6 +379,7 @@ class SparseGP(GPBase):
|
|||
xerr=2 * np.sqrt(self.X_variance[which_data, 0]),
|
||||
ecolor='k', fmt=None, elinewidth=.5, alpha=.5)
|
||||
|
||||
"""
|
||||
Zu = self.Z[self.Z[:,-1]==output,:]
|
||||
Zu = self.Z * self._Xscale + self._Xoffset
|
||||
Zu = self.Z[self.Z[:,-1]==output ,0:1] #??
|
||||
|
|
@ -388,7 +388,6 @@ class SparseGP(GPBase):
|
|||
|
||||
else:
|
||||
raise NotImplementedError, "Cannot define a frame with more than two input dimensions"
|
||||
"""
|
||||
|
||||
def predict_single_output(self, Xnew, output=0, which_parts='all', full_cov=False):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue