mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-27 13:56:23 +02:00
Merging changed files.
This commit is contained in:
commit
94ddfa7973
45 changed files with 1176 additions and 478 deletions
|
|
@ -176,7 +176,7 @@ class GP(GPBase):
|
||||||
|
|
||||||
.. Note:: For multiple output models only
|
.. Note:: For multiple output models only
|
||||||
"""
|
"""
|
||||||
assert hasattr(self,'multioutput')
|
assert hasattr(self,'multioutput'), 'This function is for multiple output models only.'
|
||||||
index = np.ones_like(Xnew)*output
|
index = np.ones_like(Xnew)*output
|
||||||
Xnew = np.hstack((Xnew,index))
|
Xnew = np.hstack((Xnew,index))
|
||||||
|
|
||||||
|
|
@ -204,8 +204,7 @@ class GP(GPBase):
|
||||||
|
|
||||||
.. Note:: For multiple output models only
|
.. Note:: For multiple output models only
|
||||||
"""
|
"""
|
||||||
assert hasattr(self,'multioutput')
|
assert hasattr(self,'multioutput'), 'This function is for multiple output models only.'
|
||||||
|
|
||||||
# creates an index column and appends it to _Xnew
|
# creates an index column and appends it to _Xnew
|
||||||
index = np.ones_like(_Xnew)*output
|
index = np.ones_like(_Xnew)*output
|
||||||
_Xnew = np.hstack((_Xnew,index))
|
_Xnew = np.hstack((_Xnew,index))
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,9 @@ class GPBase(Model):
|
||||||
fig = pb.figure(num=fignum)
|
fig = pb.figure(num=fignum)
|
||||||
ax = fig.add_subplot(111)
|
ax = fig.add_subplot(111)
|
||||||
|
|
||||||
if self.X.shape[1] == 1 and not hasattr(self,'multioutput'):
|
if not hasattr(self,'multioutput'):
|
||||||
|
|
||||||
|
if self.X.shape[1] == 1:
|
||||||
Xnew, xmin, xmax = x_frame1D(self.X, plot_limits=plot_limits)
|
Xnew, xmin, xmax = x_frame1D(self.X, plot_limits=plot_limits)
|
||||||
if samples == 0:
|
if samples == 0:
|
||||||
m, v = self._raw_predict(Xnew, which_parts=which_parts)
|
m, v = self._raw_predict(Xnew, which_parts=which_parts)
|
||||||
|
|
@ -97,17 +99,23 @@ class GPBase(Model):
|
||||||
ax.plot(self.X[which_data], self.likelihood.Y[which_data], 'kx', mew=1.5)
|
ax.plot(self.X[which_data], self.likelihood.Y[which_data], 'kx', mew=1.5)
|
||||||
else:
|
else:
|
||||||
m, v = self._raw_predict(Xnew, which_parts=which_parts, full_cov=True)
|
m, v = self._raw_predict(Xnew, 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)
|
Ysim = np.random.multivariate_normal(m.flatten(), v, samples)
|
||||||
gpplot(Xnew, m, m - 2 * np.sqrt(np.diag(v)[:, None]), m + 2 * np.sqrt(np.diag(v))[:, None, ], axes=ax)
|
gpplot(Xnew, m, m - 2 * np.sqrt(np.diag(v)[:, None]), m + 2 * np.sqrt(np.diag(v))[:, None, ], axes=ax)
|
||||||
for i in range(samples):
|
for i in range(samples):
|
||||||
ax.plot(Xnew, Ysim[i, :], Tango.colorsHex['darkBlue'], linewidth=0.25)
|
ax.plot(Xnew, Ysim[i, :], Tango.colorsHex['darkBlue'], linewidth=0.25)
|
||||||
|
|
||||||
ax.plot(self.X[which_data], self.likelihood.Y[which_data], 'kx', mew=1.5)
|
ax.plot(self.X[which_data], self.likelihood.Y[which_data], 'kx', mew=1.5)
|
||||||
ax.set_xlim(xmin, xmax)
|
ax.set_xlim(xmin, xmax)
|
||||||
ymin, ymax = min(np.append(self.likelihood.Y, m - 2 * np.sqrt(np.diag(v)[:, None]))), max(np.append(self.likelihood.Y, m + 2 * np.sqrt(np.diag(v)[:, None])))
|
ymin, ymax = min(np.append(self.likelihood.Y, m - 2 * np.sqrt(np.diag(v)[:, None]))), max(np.append(self.likelihood.Y, m + 2 * np.sqrt(np.diag(v)[:, None])))
|
||||||
ymin, ymax = ymin - 0.1 * (ymax - ymin), ymax + 0.1 * (ymax - ymin)
|
ymin, ymax = ymin - 0.1 * (ymax - ymin), ymax + 0.1 * (ymax - ymin)
|
||||||
ax.set_ylim(ymin, ymax)
|
ax.set_ylim(ymin, ymax)
|
||||||
|
|
||||||
elif self.X.shape[1] == 2 and not hasattr(self,'multioutput'):
|
if hasattr(self,'Z'):
|
||||||
|
Zu = self.Z * self._Xscale + self._Xoffset
|
||||||
|
ax.plot(Zu, np.zeros_like(Zu) + ax.get_ylim()[0], 'r|', mew=1.5, markersize=12)
|
||||||
|
|
||||||
|
elif self.X.shape[1] == 2:
|
||||||
resolution = resolution or 50
|
resolution = resolution or 50
|
||||||
Xnew, xmin, xmax, xx, yy = x_frame2D(self.X, plot_limits, resolution)
|
Xnew, xmin, xmax, xx, yy = x_frame2D(self.X, plot_limits, resolution)
|
||||||
m, v = self._raw_predict(Xnew, which_parts=which_parts)
|
m, v = self._raw_predict(Xnew, which_parts=which_parts)
|
||||||
|
|
@ -117,9 +125,12 @@ class GPBase(Model):
|
||||||
ax.set_xlim(xmin[0], xmax[0])
|
ax.set_xlim(xmin[0], xmax[0])
|
||||||
ax.set_ylim(xmin[1], xmax[1])
|
ax.set_ylim(xmin[1], xmax[1])
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
elif self.X.shape[1] == 2 and hasattr(self,'multioutput'):
|
if self.X.shape[1] == 2:
|
||||||
output -= 1
|
|
||||||
assert self.num_outputs >= output, 'The model has only %s outputs.' %self.num_outputs
|
assert self.num_outputs >= output, 'The model has only %s outputs.' %self.num_outputs
|
||||||
Xu = self.X[self.X[:,-1]==output ,0:1]
|
Xu = self.X[self.X[:,-1]==output ,0:1]
|
||||||
Xnew, xmin, xmax = x_frame1D(Xu, plot_limits=plot_limits)
|
Xnew, xmin, xmax = x_frame1D(Xu, plot_limits=plot_limits)
|
||||||
|
|
@ -130,6 +141,7 @@ class GPBase(Model):
|
||||||
ax.plot(Xu[which_data], self.likelihood.Y[self.likelihood.index==output][:,None], 'kx', mew=1.5)
|
ax.plot(Xu[which_data], self.likelihood.Y[self.likelihood.index==output][:,None], 'kx', mew=1.5)
|
||||||
else:
|
else:
|
||||||
m, v = self._raw_predict_single_output(Xnew, output=output, which_parts=which_parts, full_cov=True)
|
m, v = self._raw_predict_single_output(Xnew, output=output, 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)
|
Ysim = np.random.multivariate_normal(m.flatten(), v, samples)
|
||||||
gpplot(Xnew, m, m - 2 * np.sqrt(np.diag(v)[:, None]), m + 2 * np.sqrt(np.diag(v))[:, None, ], axes=ax)
|
gpplot(Xnew, m, m - 2 * np.sqrt(np.diag(v)[:, None]), m + 2 * np.sqrt(np.diag(v))[:, None, ], axes=ax)
|
||||||
for i in range(samples):
|
for i in range(samples):
|
||||||
|
|
@ -139,19 +151,19 @@ class GPBase(Model):
|
||||||
ymin, ymax = ymin - 0.1 * (ymax - ymin), ymax + 0.1 * (ymax - ymin)
|
ymin, ymax = ymin - 0.1 * (ymax - ymin), ymax + 0.1 * (ymax - ymin)
|
||||||
ax.set_ylim(ymin, ymax)
|
ax.set_ylim(ymin, ymax)
|
||||||
|
|
||||||
|
elif self.X.shape[1] == 3:
|
||||||
|
raise NotImplementedError, "Plots not implemented for multioutput models with 2D inputs...yet"
|
||||||
|
assert self.num_outputs >= output, 'The model has only %s outputs.' %self.num_outputs
|
||||||
|
|
||||||
|
else:
|
||||||
|
raise NotImplementedError, "Cannot define a frame with more than two input dimensions"
|
||||||
|
|
||||||
if hasattr(self,'Z'):
|
if hasattr(self,'Z'):
|
||||||
Zu = self.Z[self.Z[:,-1]==output,:]
|
Zu = self.Z[self.Z[:,-1]==output,:]
|
||||||
Zu = self.Z * self._Xscale + self._Xoffset
|
Zu = self.Z * self._Xscale + self._Xoffset
|
||||||
Zu = self.Z[self.Z[:,-1]==output ,0:1] #??
|
Zu = self.Z[self.Z[:,-1]==output ,0:1] #??
|
||||||
ax.plot(Zu, np.zeros_like(Zu) + ax.get_ylim()[0], 'r|', mew=1.5, markersize=12)
|
ax.plot(Zu, np.zeros_like(Zu) + ax.get_ylim()[0], 'r|', mew=1.5, markersize=12)
|
||||||
|
|
||||||
elif self.X.shape[1] == 3 and hasattr(self,'multioutput'):
|
|
||||||
raise NotImplementedError, "Plots not implemented for multioutput models with 2D inputs...yet"
|
|
||||||
output -= 1
|
|
||||||
assert self.num_outputs >= output, 'The model has only %s outputs.' %self.num_outputs
|
|
||||||
|
|
||||||
else:
|
|
||||||
raise NotImplementedError, "Cannot define a frame with more than two input dimensions"
|
|
||||||
|
|
||||||
def plot(self, plot_limits=None, which_data='all', which_parts='all', resolution=None, levels=20, samples=0, fignum=None, ax=None, output=None, fixed_inputs=[], linecol=Tango.colorsHex['darkBlue'],fillcol=Tango.colorsHex['lightBlue']):
|
def plot(self, plot_limits=None, which_data='all', which_parts='all', resolution=None, levels=20, samples=0, fignum=None, ax=None, output=None, fixed_inputs=[], linecol=Tango.colorsHex['darkBlue'],fillcol=Tango.colorsHex['lightBlue']):
|
||||||
"""
|
"""
|
||||||
|
|
@ -203,7 +215,7 @@ class GPBase(Model):
|
||||||
if plotdims == 1:
|
if plotdims == 1:
|
||||||
resolution = resolution or 200
|
resolution = resolution or 200
|
||||||
|
|
||||||
Xu = self.X * self._Xscale + self._Xoffset # NOTE self.X are the normalized values now
|
Xu = self.X * self._Xscale + self._Xoffset #NOTE self.X are the normalized values now
|
||||||
|
|
||||||
fixed_dims = np.array([i for i,v in fixed_inputs])
|
fixed_dims = np.array([i for i,v in fixed_inputs])
|
||||||
freedim = np.setdiff1d(np.arange(self.input_dim),fixed_dims)
|
freedim = np.setdiff1d(np.arange(self.input_dim),fixed_dims)
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ class Model(Parameterized):
|
||||||
def getstate(self):
|
def getstate(self):
|
||||||
"""
|
"""
|
||||||
Get the current state of the class.
|
Get the current state of the class.
|
||||||
|
|
||||||
Inherited from Parameterized, so add those parameters to the state
|
Inherited from Parameterized, so add those parameters to the state
|
||||||
|
|
||||||
:return: list of states from the model.
|
:return: list of states from the model.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
@ -397,17 +397,20 @@ class Model(Parameterized):
|
||||||
return np.nan
|
return np.nan
|
||||||
return 0.5 * self._get_params().size * np.log(2 * np.pi) + self.log_likelihood() - hld
|
return 0.5 * self._get_params().size * np.log(2 * np.pi) + self.log_likelihood() - hld
|
||||||
|
|
||||||
def __str__(self, names=None):
|
def __str__(self):
|
||||||
if names is None:
|
s = Parameterized.__str__(self).split('\n')
|
||||||
names = self._get_print_names()
|
#def __str__(self, names=None):
|
||||||
s = Parameterized.__str__(self, names=names).split('\n')
|
# if names is None:
|
||||||
|
# names = self._get_print_names()
|
||||||
|
#s = Parameterized.__str__(self, names=names).split('\n')
|
||||||
# add priors to the string
|
# add priors to the string
|
||||||
if self.priors is not None:
|
if self.priors is not None:
|
||||||
strs = [str(p) if p is not None else '' for p in self.priors]
|
strs = [str(p) if p is not None else '' for p in self.priors]
|
||||||
else:
|
else:
|
||||||
strs = [''] * len(self._get_param_names())
|
strs = [''] * len(self._get_params())
|
||||||
name_indices = self.grep_param_names("|".join(names))
|
# strs = [''] * len(self._get_param_names())
|
||||||
strs = np.array(strs)[name_indices]
|
# name_indices = self.grep_param_names("|".join(names))
|
||||||
|
# strs = np.array(strs)[name_indices]
|
||||||
width = np.array(max([len(p) for p in strs] + [5])) + 4
|
width = np.array(max([len(p) for p in strs] + [5])) + 4
|
||||||
|
|
||||||
log_like = self.log_likelihood()
|
log_like = self.log_likelihood()
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ class Parameterized(object):
|
||||||
|
|
||||||
def _get_param_names(self):
|
def _get_param_names(self):
|
||||||
raise NotImplementedError, "this needs to be implemented to use the Parameterized class"
|
raise NotImplementedError, "this needs to be implemented to use the Parameterized class"
|
||||||
def _get_print_names(self):
|
#def _get_print_names(self):
|
||||||
""" Override for which names to print out, when using print m """
|
# """ Override for which names to print out, when using print m """
|
||||||
return self._get_param_names()
|
# return self._get_param_names()
|
||||||
|
|
||||||
def pickle(self, filename, protocol=None):
|
def pickle(self, filename, protocol=None):
|
||||||
if protocol is None:
|
if protocol is None:
|
||||||
|
|
@ -63,8 +63,8 @@ class Parameterized(object):
|
||||||
"""
|
"""
|
||||||
Get the current state of the class,
|
Get the current state of the class,
|
||||||
here just all the indices, rest can get recomputed
|
here just all the indices, rest can get recomputed
|
||||||
|
|
||||||
For inheriting from Parameterized:
|
For inheriting from Parameterized:
|
||||||
|
|
||||||
Allways append the state of the inherited object
|
Allways append the state of the inherited object
|
||||||
and call down to the inherited object in setstate!!
|
and call down to the inherited object in setstate!!
|
||||||
"""
|
"""
|
||||||
|
|
@ -336,26 +336,30 @@ class Parameterized(object):
|
||||||
n = [nn for i, nn in enumerate(n) if not i in remove]
|
n = [nn for i, nn in enumerate(n) if not i in remove]
|
||||||
return n
|
return n
|
||||||
|
|
||||||
@property
|
#@property
|
||||||
def all(self):
|
#def all(self):
|
||||||
return self.__str__(self._get_param_names())
|
# return self.__str__(self._get_param_names())
|
||||||
|
|
||||||
|
|
||||||
def __str__(self, names=None, nw=30):
|
#def __str__(self, names=None, nw=30):
|
||||||
|
def __str__(self, nw=30):
|
||||||
"""
|
"""
|
||||||
Return a string describing the parameter names and their ties and constraints
|
Return a string describing the parameter names and their ties and constraints
|
||||||
"""
|
"""
|
||||||
if names is None:
|
names = self._get_param_names()
|
||||||
names = self._get_print_names()
|
#if names is None:
|
||||||
name_indices = self.grep_param_names("|".join(names))
|
# names = self._get_print_names()
|
||||||
|
#name_indices = self.grep_param_names("|".join(names))
|
||||||
N = len(names)
|
N = len(names)
|
||||||
|
|
||||||
if not N:
|
if not N:
|
||||||
return "This object has no free parameters."
|
return "This object has no free parameters."
|
||||||
header = ['Name', 'Value', 'Constraints', 'Ties']
|
header = ['Name', 'Value', 'Constraints', 'Ties']
|
||||||
values = self._get_params()[name_indices] # map(str,self._get_params())
|
values = self._get_params() # map(str,self._get_params())
|
||||||
|
#values = self._get_params()[name_indices] # map(str,self._get_params())
|
||||||
# sort out the constraints
|
# sort out the constraints
|
||||||
constraints = [''] * len(self._get_param_names())
|
constraints = [''] * len(names)
|
||||||
|
#constraints = [''] * len(self._get_param_names())
|
||||||
for i, t in zip(self.constrained_indices, self.constraints):
|
for i, t in zip(self.constrained_indices, self.constraints):
|
||||||
for ii in i:
|
for ii in i:
|
||||||
constraints[ii] = t.__str__()
|
constraints[ii] = t.__str__()
|
||||||
|
|
@ -368,6 +372,9 @@ class Parameterized(object):
|
||||||
for j in tie:
|
for j in tie:
|
||||||
ties[j] = '(' + str(i) + ')'
|
ties[j] = '(' + str(i) + ')'
|
||||||
|
|
||||||
|
if values.size == 1:
|
||||||
|
values = ['%.4f' %float(values)]
|
||||||
|
else:
|
||||||
values = ['%.4f' % float(v) for v in values]
|
values = ['%.4f' % float(v) for v in values]
|
||||||
max_names = max([len(names[i]) for i in range(len(names))] + [len(header[0])])
|
max_names = max([len(names[i]) for i in range(len(names))] + [len(header[0])])
|
||||||
max_values = max([len(values[i]) for i in range(len(values))] + [len(header[1])])
|
max_values = max([len(values[i]) for i in range(len(values))] + [len(header[1])])
|
||||||
|
|
@ -383,3 +390,77 @@ class Parameterized(object):
|
||||||
|
|
||||||
|
|
||||||
return ('\n'.join([header_string[0], separator] + param_string)) + '\n'
|
return ('\n'.join([header_string[0], separator] + param_string)) + '\n'
|
||||||
|
|
||||||
|
def grep_model(self,regexp):
|
||||||
|
regexp_indices = self.grep_param_names(regexp)
|
||||||
|
all_names = self._get_param_names()
|
||||||
|
|
||||||
|
names = [all_names[pj] for pj in regexp_indices]
|
||||||
|
N = len(names)
|
||||||
|
|
||||||
|
if not N:
|
||||||
|
return "Match not found."
|
||||||
|
|
||||||
|
header = ['Name', 'Value', 'Constraints', 'Ties']
|
||||||
|
all_values = self._get_params()
|
||||||
|
values = np.array([all_values[pj] for pj in regexp_indices])
|
||||||
|
constraints = [''] * len(names)
|
||||||
|
|
||||||
|
_constrained_indices,aux = self._pick_elements(regexp_indices,self.constrained_indices)
|
||||||
|
_constraints = [self.constraints[pj] for pj in aux]
|
||||||
|
|
||||||
|
for i, t in zip(_constrained_indices, _constraints):
|
||||||
|
for ii in i:
|
||||||
|
iii = regexp_indices.tolist().index(ii)
|
||||||
|
constraints[iii] = t.__str__()
|
||||||
|
|
||||||
|
_fixed_indices,aux = self._pick_elements(regexp_indices,self.fixed_indices)
|
||||||
|
for i in _fixed_indices:
|
||||||
|
for ii in i:
|
||||||
|
iii = regexp_indices.tolist().index(ii)
|
||||||
|
constraints[ii] = 'Fixed'
|
||||||
|
|
||||||
|
_tied_indices,aux = self._pick_elements(regexp_indices,self.tied_indices)
|
||||||
|
ties = [''] * len(names)
|
||||||
|
for i,ti in zip(_tied_indices,aux):
|
||||||
|
for ii in i:
|
||||||
|
iii = regexp_indices.tolist().index(ii)
|
||||||
|
ties[iii] = '(' + str(ti) + ')'
|
||||||
|
|
||||||
|
if values.size == 1:
|
||||||
|
values = ['%.4f' %float(values)]
|
||||||
|
else:
|
||||||
|
values = ['%.4f' % float(v) for v in values]
|
||||||
|
|
||||||
|
max_names = max([len(names[i]) for i in range(len(names))] + [len(header[0])])
|
||||||
|
max_values = max([len(values[i]) for i in range(len(values))] + [len(header[1])])
|
||||||
|
max_constraint = max([len(constraints[i]) for i in range(len(constraints))] + [len(header[2])])
|
||||||
|
max_ties = max([len(ties[i]) for i in range(len(ties))] + [len(header[3])])
|
||||||
|
cols = np.array([max_names, max_values, max_constraint, max_ties]) + 4
|
||||||
|
|
||||||
|
header_string = ["{h:^{col}}".format(h=header[i], col=cols[i]) for i in range(len(cols))]
|
||||||
|
header_string = map(lambda x: '|'.join(x), [header_string])
|
||||||
|
separator = '-' * len(header_string[0])
|
||||||
|
param_string = ["{n:^{c0}}|{v:^{c1}}|{c:^{c2}}|{t:^{c3}}".format(n=names[i], v=values[i], c=constraints[i], t=ties[i], c0=cols[0], c1=cols[1], c2=cols[2], c3=cols[3]) for i in range(len(values))]
|
||||||
|
|
||||||
|
print header_string[0]
|
||||||
|
print separator
|
||||||
|
for string in param_string:
|
||||||
|
print string
|
||||||
|
|
||||||
|
def _pick_elements(self,regexp_ind,array_list):
|
||||||
|
"""Removes from array_list the elements different from regexp_ind"""
|
||||||
|
new_array_list = [] #New list with elements matching regexp_ind
|
||||||
|
array_indices = [] #Indices that matches the arrays in new_array_list and array_list
|
||||||
|
|
||||||
|
array_index = 0
|
||||||
|
for array in array_list:
|
||||||
|
_new = []
|
||||||
|
for ai in array:
|
||||||
|
if ai in regexp_ind:
|
||||||
|
_new.append(ai)
|
||||||
|
if len(_new):
|
||||||
|
new_array_list.append(np.array(_new))
|
||||||
|
array_indices.append(array_index)
|
||||||
|
array_index += 1
|
||||||
|
return new_array_list, array_indices
|
||||||
|
|
|
||||||
|
|
@ -165,13 +165,17 @@ class SparseGP(GPBase):
|
||||||
raise NotImplementedError, "heteroscedatic derivates with uncertain inputs not implemented"
|
raise NotImplementedError, "heteroscedatic derivates with uncertain inputs not implemented"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
LBi = chol_inv(self.LB)
|
||||||
Lmi_psi1, nil = dtrtrs(self._Lm, np.asfortranarray(self.psi1.T), lower=1, trans=0)
|
Lmi_psi1, nil = dtrtrs(self._Lm, np.asfortranarray(self.psi1.T), lower=1, trans=0)
|
||||||
_LBi_Lmi_psi1, _ = dtrtrs(self.LB, np.asfortranarray(Lmi_psi1), lower=1, trans=0)
|
_LBi_Lmi_psi1, _ = dtrtrs(self.LB, np.asfortranarray(Lmi_psi1), lower=1, trans=0)
|
||||||
_Bi_Lmi_psi1, _ = dtrtrs(self.LB.T, np.asfortranarray(_LBi_Lmi_psi1), lower=1, trans=0)
|
|
||||||
|
|
||||||
self.partial_for_likelihood = -0.5 * self.likelihood.precision + 0.5 * self.likelihood.V**2
|
self.partial_for_likelihood = -0.5 * self.likelihood.precision + 0.5 * self.likelihood.V**2
|
||||||
self.partial_for_likelihood += 0.5 * self.output_dim * (self.psi0 - np.sum(Lmi_psi1**2,0))[:,None] * self.likelihood.precision**2
|
self.partial_for_likelihood += 0.5 * self.output_dim * (self.psi0 - np.sum(Lmi_psi1**2,0))[:,None] * self.likelihood.precision**2
|
||||||
self.partial_for_likelihood += 0.5*np.sum(_Bi_Lmi_psi1*Lmi_psi1,0)[:,None]*self.likelihood.precision**2 #NOTE this term has numerical issues
|
|
||||||
|
self.partial_for_likelihood += 0.5*np.sum(mdot(LBi.T,LBi,Lmi_psi1)*Lmi_psi1,0)[:,None]*self.likelihood.precision**2
|
||||||
|
|
||||||
self.partial_for_likelihood += -np.dot(self._LBi_Lmi_psi1Vf.T,_LBi_Lmi_psi1).T * self.likelihood.Y * self.likelihood.precision**2
|
self.partial_for_likelihood += -np.dot(self._LBi_Lmi_psi1Vf.T,_LBi_Lmi_psi1).T * self.likelihood.Y * self.likelihood.precision**2
|
||||||
self.partial_for_likelihood += 0.5*np.dot(self._LBi_Lmi_psi1Vf.T,_LBi_Lmi_psi1).T**2 * self.likelihood.precision**2
|
self.partial_for_likelihood += 0.5*np.dot(self._LBi_Lmi_psi1Vf.T,_LBi_Lmi_psi1).T**2 * self.likelihood.precision**2
|
||||||
|
|
||||||
|
|
@ -208,8 +212,8 @@ class SparseGP(GPBase):
|
||||||
return sum([['iip_%i_%i' % (i, j) for j in range(self.Z.shape[1])] for i in range(self.Z.shape[0])], [])\
|
return sum([['iip_%i_%i' % (i, j) for j in range(self.Z.shape[1])] for i in range(self.Z.shape[0])], [])\
|
||||||
+ self.kern._get_param_names_transformed() + self.likelihood._get_param_names()
|
+ self.kern._get_param_names_transformed() + self.likelihood._get_param_names()
|
||||||
|
|
||||||
def _get_print_names(self):
|
#def _get_print_names(self):
|
||||||
return self.kern._get_param_names_transformed() + self.likelihood._get_param_names()
|
# return self.kern._get_param_names_transformed() + self.likelihood._get_param_names()
|
||||||
|
|
||||||
def update_likelihood_approximation(self):
|
def update_likelihood_approximation(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -288,7 +292,7 @@ class SparseGP(GPBase):
|
||||||
Kxx = self.kern.Kdiag(Xnew, which_parts=which_parts)
|
Kxx = self.kern.Kdiag(Xnew, which_parts=which_parts)
|
||||||
var = Kxx - np.sum(Kx * np.dot(Kmmi_LmiBLmi, Kx), 0)
|
var = Kxx - np.sum(Kx * np.dot(Kmmi_LmiBLmi, Kx), 0)
|
||||||
else:
|
else:
|
||||||
# assert which_p.Tarts=='all', "swithching out parts of variational kernels is not implemented"
|
# assert which_parts=='all', "swithching out parts of variational kernels is not implemented"
|
||||||
Kx = self.kern.psi1(self.Z, Xnew, X_variance_new) # , which_parts=which_parts) TODO: which_parts
|
Kx = self.kern.psi1(self.Z, Xnew, X_variance_new) # , which_parts=which_parts) TODO: which_parts
|
||||||
mu = np.dot(Kx, self.Cpsi1V)
|
mu = np.dot(Kx, self.Cpsi1V)
|
||||||
if full_cov:
|
if full_cov:
|
||||||
|
|
@ -344,7 +348,10 @@ class SparseGP(GPBase):
|
||||||
which_data = slice(None)
|
which_data = slice(None)
|
||||||
|
|
||||||
GPBase.plot(self, samples=0, plot_limits=plot_limits, which_data='all', which_parts='all', resolution=None, levels=20, ax=ax, output=output)
|
GPBase.plot(self, samples=0, plot_limits=plot_limits, which_data='all', which_parts='all', resolution=None, levels=20, ax=ax, output=output)
|
||||||
if self.X.shape[1] == 1 and not hasattr(self,'multioutput'):
|
|
||||||
|
if not hasattr(self,'multioutput'):
|
||||||
|
|
||||||
|
if self.X.shape[1] == 1:
|
||||||
if self.has_uncertain_inputs:
|
if self.has_uncertain_inputs:
|
||||||
Xu = self.X * self._Xscale + self._Xoffset # NOTE self.X are the normalized values now
|
Xu = self.X * self._Xscale + self._Xoffset # NOTE self.X are the normalized values now
|
||||||
ax.errorbar(Xu[which_data, 0], self.likelihood.data[which_data, 0],
|
ax.errorbar(Xu[which_data, 0], self.likelihood.data[which_data, 0],
|
||||||
|
|
@ -353,11 +360,14 @@ class SparseGP(GPBase):
|
||||||
Zu = self.Z * self._Xscale + self._Xoffset
|
Zu = self.Z * self._Xscale + self._Xoffset
|
||||||
ax.plot(Zu, np.zeros_like(Zu) + ax.get_ylim()[0], 'r|', mew=1.5, markersize=12)
|
ax.plot(Zu, np.zeros_like(Zu) + ax.get_ylim()[0], 'r|', mew=1.5, markersize=12)
|
||||||
|
|
||||||
elif self.X.shape[1] == 2 and not hasattr(self,'multioutput'):
|
elif self.X.shape[1] == 2:
|
||||||
Zu = self.Z * self._Xscale + self._Xoffset
|
Zu = self.Z * self._Xscale + self._Xoffset
|
||||||
ax.plot(Zu[:, 0], Zu[:, 1], 'wo')
|
ax.plot(Zu[:, 0], Zu[:, 1], 'wo')
|
||||||
|
|
||||||
elif self.X.shape[1] == 2 and hasattr(self,'multioutput'):
|
else:
|
||||||
|
pass
|
||||||
|
"""
|
||||||
|
if self.X.shape[1] == 2 and hasattr(self,'multioutput'):
|
||||||
Xu = self.X[self.X[:,-1]==output,:]
|
Xu = self.X[self.X[:,-1]==output,:]
|
||||||
if self.has_uncertain_inputs:
|
if self.has_uncertain_inputs:
|
||||||
Xu = self.X * self._Xscale + self._Xoffset # NOTE self.X are the normalized values now
|
Xu = self.X * self._Xscale + self._Xoffset # NOTE self.X are the normalized values now
|
||||||
|
|
@ -376,6 +386,7 @@ class SparseGP(GPBase):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError, "Cannot define a frame with more than two input dimensions"
|
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):
|
def predict_single_output(self, Xnew, output=0, which_parts='all', full_cov=False):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -166,3 +166,35 @@ def FITC_crescent_data(num_inducing=10, seed=default_seed):
|
||||||
print(m)
|
print(m)
|
||||||
m.plot()
|
m.plot()
|
||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
def toy_heaviside(seed=default_seed):
|
||||||
|
"""
|
||||||
|
Simple 1D classification example using a heavy side gp transformation
|
||||||
|
:param seed : seed value for data generation (default is 4).
|
||||||
|
:type seed: int
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = GPy.util.datasets.toy_linear_1d_classification(seed=seed)
|
||||||
|
Y = data['Y'][:, 0:1]
|
||||||
|
Y[Y.flatten() == -1] = 0
|
||||||
|
|
||||||
|
# Model definition
|
||||||
|
noise_model = GPy.likelihoods.binomial(GPy.likelihoods.noise_models.gp_transformations.Heaviside())
|
||||||
|
likelihood = GPy.likelihoods.EP(Y,noise_model)
|
||||||
|
m = GPy.models.GPClassification(data['X'], likelihood=likelihood)
|
||||||
|
|
||||||
|
# Optimize
|
||||||
|
m.update_likelihood_approximation()
|
||||||
|
# Parameters optimization:
|
||||||
|
m.optimize()
|
||||||
|
#m.pseudo_EM()
|
||||||
|
|
||||||
|
# Plot
|
||||||
|
fig, axes = pb.subplots(2,1)
|
||||||
|
m.plot_f(ax=axes[0])
|
||||||
|
m.plot(ax=axes[1])
|
||||||
|
print(m)
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ import pylab as pb
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import GPy
|
import GPy
|
||||||
|
|
||||||
def coregionalisation_toy2(max_iters=100):
|
def coregionalization_toy2(max_iters=100):
|
||||||
"""
|
"""
|
||||||
A simple demonstration of coregionalisation on two sinusoidal functions.
|
A simple demonstration of coregionalization on two sinusoidal functions.
|
||||||
"""
|
"""
|
||||||
X1 = np.random.rand(50, 1) * 8
|
X1 = np.random.rand(50, 1) * 8
|
||||||
X2 = np.random.rand(30, 1) * 5
|
X2 = np.random.rand(30, 1) * 5
|
||||||
|
|
@ -40,9 +40,9 @@ def coregionalisation_toy2(max_iters=100):
|
||||||
pb.plot(X2[:, 0], Y2[:, 0], 'gx', mew=2)
|
pb.plot(X2[:, 0], Y2[:, 0], 'gx', mew=2)
|
||||||
return m
|
return m
|
||||||
|
|
||||||
def coregionalisation_toy(max_iters=100):
|
def coregionalization_toy(max_iters=100):
|
||||||
"""
|
"""
|
||||||
A simple demonstration of coregionalisation on two sinusoidal functions.
|
A simple demonstration of coregionalization on two sinusoidal functions.
|
||||||
"""
|
"""
|
||||||
X1 = np.random.rand(50, 1) * 8
|
X1 = np.random.rand(50, 1) * 8
|
||||||
X2 = np.random.rand(30, 1) * 5
|
X2 = np.random.rand(30, 1) * 5
|
||||||
|
|
@ -63,9 +63,9 @@ def coregionalisation_toy(max_iters=100):
|
||||||
axes[1].set_title('Output 1')
|
axes[1].set_title('Output 1')
|
||||||
return m
|
return m
|
||||||
|
|
||||||
def coregionalisation_sparse(max_iters=100):
|
def coregionalization_sparse(max_iters=100):
|
||||||
"""
|
"""
|
||||||
A simple demonstration of coregionalisation on two sinusoidal functions using sparse approximations.
|
A simple demonstration of coregionalization on two sinusoidal functions using sparse approximations.
|
||||||
"""
|
"""
|
||||||
X1 = np.random.rand(500, 1) * 8
|
X1 = np.random.rand(500, 1) * 8
|
||||||
X2 = np.random.rand(300, 1) * 5
|
X2 = np.random.rand(300, 1) * 5
|
||||||
|
|
@ -75,41 +75,18 @@ def coregionalisation_sparse(max_iters=100):
|
||||||
Y2 = -np.sin(X2) + np.random.randn(*X2.shape) * 0.05
|
Y2 = -np.sin(X2) + np.random.randn(*X2.shape) * 0.05
|
||||||
Y = np.vstack((Y1, Y2))
|
Y = np.vstack((Y1, Y2))
|
||||||
|
|
||||||
num_inducing = 40
|
|
||||||
Z = np.hstack((np.random.rand(num_inducing, 1) * 8, np.random.randint(0, 2, num_inducing)[:, None]))
|
|
||||||
Z = np.hstack((np.random.rand(num_inducing, 1) * 8, np.random.randint(0, 2, num_inducing)[:, None]))
|
|
||||||
|
|
||||||
k1 = GPy.kern.rbf(1)
|
k1 = GPy.kern.rbf(1)
|
||||||
|
|
||||||
m = GPy.models.SparseGPMultioutputRegression(X_list=[X1,X2],Y_list=[Y1,Y2],kernel_list=[k1],num_inducing=20)
|
m = GPy.models.SparseGPMultioutputRegression(X_list=[X1,X2],Y_list=[Y1,Y2],kernel_list=[k1],num_inducing=20)
|
||||||
#k2 = GPy.kern.coregionalize(2, 2)
|
m.constrain_fixed('.*rbf_var',1.)
|
||||||
#k = k1**k2 #.prod(k2, tensor=True) # + GPy.kern.white(2,0.001)
|
m.optimize(messages=1)
|
||||||
#m = GPy.models.SparseGPRegression(X, Y, kernel=k, Z=Z)
|
#m.optimize_restarts(5, robust=True, messages=1, max_iters=max_iters, optimizer='bfgs')
|
||||||
m.constrain_fixed('.*rbf_var', 1.)
|
|
||||||
|
|
||||||
#m.constrain_fixed('iip')
|
|
||||||
#m.constrain_bounded('noise_variance', 1e-3, 1e-1)
|
|
||||||
# m.optimize_restarts(5, robust=True, messages=1, max_iters=max_iters, optimizer='bfgs')
|
|
||||||
m.optimize(max_iters=max_iters)
|
|
||||||
|
|
||||||
fig, axes = pb.subplots(2,1)
|
fig, axes = pb.subplots(2,1)
|
||||||
m.plot(output=0,ax=axes[0])
|
m.plot(output=0,ax=axes[0])
|
||||||
m.plot(output=1,ax=axes[1])
|
m.plot(output=1,ax=axes[1])
|
||||||
axes[0].set_title('Output 0')
|
axes[0].set_title('Output 0')
|
||||||
axes[1].set_title('Output 1')
|
axes[1].set_title('Output 1')
|
||||||
# plotting:
|
|
||||||
#pb.figure()
|
|
||||||
#Xtest1 = np.hstack((np.linspace(0, 9, 100)[:, None], np.zeros((100, 1))))
|
|
||||||
#Xtest2 = np.hstack((np.linspace(0, 9, 100)[:, None], np.ones((100, 1))))
|
|
||||||
#mean, var, low, up = m.predict(Xtest1)
|
|
||||||
#GPy.util.plot.gpplot(Xtest1[:, 0], mean, low, up)
|
|
||||||
#mean, var, low, up = m.predict(Xtest2)
|
|
||||||
#GPy.util.plot.gpplot(Xtest2[:, 0], mean, low, up)
|
|
||||||
#pb.plot(X1[:, 0], Y1[:, 0], 'rx', mew=2)
|
|
||||||
#pb.plot(X2[:, 0], Y2[:, 0], 'gx', mew=2)
|
|
||||||
#y = pb.ylim()[0]
|
|
||||||
#pb.plot(Z[:, 0][Z[:, 1] == 0], np.zeros(np.sum(Z[:, 1] == 0)) + y, 'r|', mew=2)
|
|
||||||
#pb.plot(Z[:, 0][Z[:, 1] == 1], np.zeros(np.sum(Z[:, 1] == 1)) + y, 'g|', mew=2)
|
|
||||||
return m
|
return m
|
||||||
|
|
||||||
def epomeo_gpx(max_iters=100):
|
def epomeo_gpx(max_iters=100):
|
||||||
|
|
|
||||||
|
|
@ -373,7 +373,7 @@ def symmetric(k):
|
||||||
k_.parts = [symmetric.Symmetric(p) for p in k.parts]
|
k_.parts = [symmetric.Symmetric(p) for p in k.parts]
|
||||||
return k_
|
return k_
|
||||||
|
|
||||||
def coregionalize(output_dim,W_columns=1, W=None, kappa=None):
|
def coregionalize(output_dim,rank=1, W=None, kappa=None):
|
||||||
"""
|
"""
|
||||||
Coregionlization matrix B, of the form:
|
Coregionlization matrix B, of the form:
|
||||||
.. math::
|
.. math::
|
||||||
|
|
@ -387,16 +387,16 @@ def coregionalize(output_dim,W_columns=1, W=None, kappa=None):
|
||||||
|
|
||||||
:param output_dim: the number of outputs to corregionalize
|
:param output_dim: the number of outputs to corregionalize
|
||||||
:type output_dim: int
|
:type output_dim: int
|
||||||
:param W_columns: number of columns of the W matrix (this parameter is ignored if parameter W is not None)
|
:param rank: number of columns of the W matrix (this parameter is ignored if parameter W is not None)
|
||||||
:type W_colunns: int
|
:type rank: int
|
||||||
:param W: a low rank matrix that determines the correlations between the different outputs, together with kappa it forms the coregionalisation matrix B
|
:param W: a low rank matrix that determines the correlations between the different outputs, together with kappa it forms the coregionalization matrix B
|
||||||
:type W: numpy array of dimensionality (num_outpus, W_columns)
|
:type W: numpy array of dimensionality (num_outpus, rank)
|
||||||
:param kappa: a vector which allows the outputs to behave independently
|
:param kappa: a vector which allows the outputs to behave independently
|
||||||
:type kappa: numpy array of dimensionality (output_dim,)
|
:type kappa: numpy array of dimensionality (output_dim,)
|
||||||
:rtype: kernel object
|
:rtype: kernel object
|
||||||
|
|
||||||
"""
|
"""
|
||||||
p = parts.coregionalize.Coregionalize(output_dim,W_columns,W,kappa)
|
p = parts.coregionalize.Coregionalize(output_dim,rank,W,kappa)
|
||||||
return kern(1,[p])
|
return kern(1,[p])
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -456,7 +456,7 @@ def hierarchical(k):
|
||||||
_parts = [parts.hierarchical.Hierarchical(k.parts)]
|
_parts = [parts.hierarchical.Hierarchical(k.parts)]
|
||||||
return kern(k.input_dim+len(k.parts),_parts)
|
return kern(k.input_dim+len(k.parts),_parts)
|
||||||
|
|
||||||
def build_lcm(input_dim, output_dim, kernel_list = [], W_columns=1,W=None,kappa=None):
|
def build_lcm(input_dim, output_dim, kernel_list = [], rank=1,W=None,kappa=None):
|
||||||
"""
|
"""
|
||||||
Builds a kernel of a linear coregionalization model
|
Builds a kernel of a linear coregionalization model
|
||||||
|
|
||||||
|
|
@ -464,8 +464,8 @@ def build_lcm(input_dim, output_dim, kernel_list = [], W_columns=1,W=None,kappa=
|
||||||
:output_dim: Number of outputs
|
:output_dim: Number of outputs
|
||||||
:kernel_list: List of coregionalized kernels, each element in the list will be multiplied by a different corregionalization matrix
|
:kernel_list: List of coregionalized kernels, each element in the list will be multiplied by a different corregionalization matrix
|
||||||
:type kernel_list: list of GPy kernels
|
:type kernel_list: list of GPy kernels
|
||||||
:param W_columns: number tuples of the corregionalization parameters 'coregion_W'
|
:param rank: number tuples of the corregionalization parameters 'coregion_W'
|
||||||
:type W_columns: integer
|
:type rank: integer
|
||||||
|
|
||||||
..Note the kernels dimensionality is overwritten to fit input_dim
|
..Note the kernels dimensionality is overwritten to fit input_dim
|
||||||
"""
|
"""
|
||||||
|
|
@ -475,11 +475,11 @@ def build_lcm(input_dim, output_dim, kernel_list = [], W_columns=1,W=None,kappa=
|
||||||
k.input_dim = input_dim
|
k.input_dim = input_dim
|
||||||
warnings.warn("kernel's input dimension overwritten to fit input_dim parameter.")
|
warnings.warn("kernel's input dimension overwritten to fit input_dim parameter.")
|
||||||
|
|
||||||
k_coreg = coregionalize(output_dim,W_columns,W,kappa)
|
k_coreg = coregionalize(output_dim,rank,W,kappa)
|
||||||
kernel = kernel_list[0]**k_coreg.copy()
|
kernel = kernel_list[0]**k_coreg.copy()
|
||||||
|
|
||||||
for k in kernel_list[1:]:
|
for k in kernel_list[1:]:
|
||||||
k_coreg = coregionalize(output_dim,W_columns,W,kappa)
|
k_coreg = coregionalize(output_dim,rank,W,kappa)
|
||||||
kernel += k**k_coreg.copy()
|
kernel += k**k_coreg.copy()
|
||||||
|
|
||||||
return kernel
|
return kernel
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import eq_ode1
|
||||||
import finite_dimensional
|
import finite_dimensional
|
||||||
import fixed
|
import fixed
|
||||||
import gibbs
|
import gibbs
|
||||||
import hetero #hetero.py is not commited: omitting for now. JH.
|
import hetero
|
||||||
import hierarchical
|
import hierarchical
|
||||||
import independent_outputs
|
import independent_outputs
|
||||||
import linear
|
import linear
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ class Coregionalize(Kernpart):
|
||||||
|
|
||||||
:param output_dim: number of outputs to coregionalize
|
:param output_dim: number of outputs to coregionalize
|
||||||
:type output_dim: int
|
:type output_dim: int
|
||||||
:param W_columns: number of columns of the W matrix (this parameter is ignored if parameter W is not None)
|
:param rank: number of columns of the W matrix (this parameter is ignored if parameter W is not None)
|
||||||
:type W_colunns: int
|
:type rank: int
|
||||||
:param W: a low rank matrix that determines the correlations between the different outputs, together with kappa it forms the coregionalization matrix B
|
:param W: a low rank matrix that determines the correlations between the different outputs, together with kappa it forms the coregionalization matrix B
|
||||||
:type W: numpy array of dimensionality (num_outpus, W_columns)
|
:type W: numpy array of dimensionality (num_outpus, W_columns)
|
||||||
:param kappa: a vector which allows the outputs to behave independently
|
:param kappa: a vector which allows the outputs to behave independently
|
||||||
|
|
@ -38,6 +38,8 @@ class Coregionalize(Kernpart):
|
||||||
self.name = 'coregion'
|
self.name = 'coregion'
|
||||||
self.output_dim = output_dim
|
self.output_dim = output_dim
|
||||||
self.rank = rank
|
self.rank = rank
|
||||||
|
if self.rank>output_dim-1:
|
||||||
|
print("Warning: Unusual choice of rank, it should normally be less than the output_dim.")
|
||||||
if W is None:
|
if W is None:
|
||||||
self.W = 0.5*np.random.randn(self.output_dim,self.rank)/np.sqrt(self.rank)
|
self.W = 0.5*np.random.randn(self.output_dim,self.rank)/np.sqrt(self.rank)
|
||||||
else:
|
else:
|
||||||
|
|
@ -158,4 +160,5 @@ class Coregionalize(Kernpart):
|
||||||
target += np.hstack([dW.flatten(),dkappa])
|
target += np.hstack([dW.flatten(),dkappa])
|
||||||
|
|
||||||
def dK_dX(self,dL_dK,X,X2,target):
|
def dK_dX(self,dL_dK,X,X2,target):
|
||||||
|
#NOTE In this case, pass is equivalent to returning zero.
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ class POLY(Kernpart):
|
||||||
|
|
||||||
The kernel is not recommended as it is badly behaved when the
|
The kernel is not recommended as it is badly behaved when the
|
||||||
\sigma^2_w*x'*y + \sigma^2_b has a magnitude greater than one. For completeness
|
\sigma^2_w*x'*y + \sigma^2_b has a magnitude greater than one. For completeness
|
||||||
there is an automatic relevance determination version of this
|
there will be an automatic relevance determination version of this
|
||||||
kernel provided.
|
kernel provided (NOT YET IMPLEMENTED!).
|
||||||
|
|
||||||
:param input_dim: the number of input dimensions
|
:param input_dim: the number of input dimensions
|
||||||
:type input_dim: int
|
:type input_dim: int
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||||
|
|
||||||
from kernpart import Kernpart
|
from kernpart import Kernpart
|
||||||
|
from coregionalize import Coregionalize
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
|
|
@ -18,7 +19,7 @@ class Prod(Kernpart):
|
||||||
"""
|
"""
|
||||||
def __init__(self,k1,k2,tensor=False):
|
def __init__(self,k1,k2,tensor=False):
|
||||||
self.num_params = k1.num_params + k2.num_params
|
self.num_params = k1.num_params + k2.num_params
|
||||||
self.name = '['+k1.name + '(x)' + k2.name +']'
|
self.name = '['+k1.name + '**' + k2.name +']'
|
||||||
self.k1 = k1
|
self.k1 = k1
|
||||||
self.k2 = k2
|
self.k2 = k2
|
||||||
if tensor:
|
if tensor:
|
||||||
|
|
@ -90,6 +91,16 @@ class Prod(Kernpart):
|
||||||
def dK_dX(self,dL_dK,X,X2,target):
|
def dK_dX(self,dL_dK,X,X2,target):
|
||||||
"""derivative of the covariance matrix with respect to X."""
|
"""derivative of the covariance matrix with respect to X."""
|
||||||
self._K_computations(X,X2)
|
self._K_computations(X,X2)
|
||||||
|
if X2 is None:
|
||||||
|
if not isinstance(self.k1,Coregionalize) and not isinstance(self.k2,Coregionalize):
|
||||||
|
self.k1.dK_dX(dL_dK*self._K2, X[:,self.slice1], None, target[:,self.slice1])
|
||||||
|
self.k2.dK_dX(dL_dK*self._K1, X[:,self.slice2], None, target[:,self.slice2])
|
||||||
|
else:#if isinstance(self.k1,Coregionalize) or isinstance(self.k2,Coregionalize):
|
||||||
|
#NOTE The indices column in the inputs makes the ki.dK_dX fail when passing None instead of X[:,self.slicei]
|
||||||
|
X2 = X
|
||||||
|
self.k1.dK_dX(2.*dL_dK*self._K2, X[:,self.slice1], X2[:,self.slice1], target[:,self.slice1])
|
||||||
|
self.k2.dK_dX(2.*dL_dK*self._K1, X[:,self.slice2], X2[:,self.slice2], target[:,self.slice2])
|
||||||
|
else:
|
||||||
self.k1.dK_dX(dL_dK*self._K2, X[:,self.slice1], X2[:,self.slice1], target[:,self.slice1])
|
self.k1.dK_dX(dL_dK*self._K2, X[:,self.slice1], X2[:,self.slice1], target[:,self.slice1])
|
||||||
self.k2.dK_dX(dL_dK*self._K1, X[:,self.slice2], X2[:,self.slice2], target[:,self.slice2])
|
self.k2.dK_dX(dL_dK*self._K1, X[:,self.slice2], X2[:,self.slice2], target[:,self.slice2])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class RationalQuadratic(Kernpart):
|
||||||
dist2 = np.square((X-X2.T)/self.lengthscale)
|
dist2 = np.square((X-X2.T)/self.lengthscale)
|
||||||
|
|
||||||
dvar = (1 + dist2/2.)**(-self.power)
|
dvar = (1 + dist2/2.)**(-self.power)
|
||||||
dl = self.power * self.variance * dist2 * self.lengthscale**(-3) * (1 + dist2/2./self.power)**(-self.power-1)
|
dl = self.power * self.variance * dist2 / self.lengthscale * (1 + dist2/2.)**(-self.power-1)
|
||||||
dp = - self.variance * np.log(1 + dist2/2.) * (1 + dist2/2.)**(-self.power)
|
dp = - self.variance * np.log(1 + dist2/2.) * (1 + dist2/2.)**(-self.power)
|
||||||
|
|
||||||
target[0] += np.sum(dvar*dL_dK)
|
target[0] += np.sum(dvar*dL_dK)
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ class EP(likelihood):
|
||||||
self.VVT_factor = self.V
|
self.VVT_factor = self.V
|
||||||
self.trYYT = 0.
|
self.trYYT = 0.
|
||||||
|
|
||||||
|
super(EP, self).__init__()
|
||||||
|
|
||||||
def restart(self):
|
def restart(self):
|
||||||
self.tau_tilde = np.zeros(self.N)
|
self.tau_tilde = np.zeros(self.N)
|
||||||
self.v_tilde = np.zeros(self.N)
|
self.v_tilde = np.zeros(self.N)
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ class Gaussian(likelihood):
|
||||||
self._variance = np.asarray(variance) + 1.
|
self._variance = np.asarray(variance) + 1.
|
||||||
self._set_params(np.asarray(variance))
|
self._set_params(np.asarray(variance))
|
||||||
|
|
||||||
|
super(Gaussian, self).__init__()
|
||||||
|
|
||||||
def set_data(self, data):
|
def set_data(self, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
self.N, D = data.shape
|
self.N, D = data.shape
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,8 @@ class Gaussian_Mixed_Noise(likelihood):
|
||||||
self.set_data(data_list)
|
self.set_data(data_list)
|
||||||
self._set_params(np.asarray(noise_params))
|
self._set_params(np.asarray(noise_params))
|
||||||
|
|
||||||
|
super(Gaussian_Mixed_Noise, self).__init__()
|
||||||
|
|
||||||
def set_data(self, data_list):
|
def set_data(self, data_list):
|
||||||
self.data = np.vstack(data_list)
|
self.data = np.vstack(data_list)
|
||||||
self.N, D = self.data.shape
|
self.N, D = self.data.shape
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import copy
|
import copy
|
||||||
|
from ..core.parameterized import Parameterized
|
||||||
|
|
||||||
class likelihood:
|
class likelihood(Parameterized):
|
||||||
"""
|
"""
|
||||||
The atom for a likelihood class
|
The atom for a likelihood class
|
||||||
|
|
||||||
|
|
@ -18,8 +19,8 @@ class likelihood:
|
||||||
self.YYT : (optional) = np.dot(self.Y, self.Y.T) enables computational savings for D>N
|
self.YYT : (optional) = np.dot(self.Y, self.Y.T) enables computational savings for D>N
|
||||||
self.V : self.precision * self.Y
|
self.V : self.precision * self.Y
|
||||||
"""
|
"""
|
||||||
def __init__(self,data):
|
def __init__(self):
|
||||||
raise ValueError, "this class is not to be instantiated"
|
Parameterized.__init__(self)
|
||||||
|
|
||||||
def _get_params(self):
|
def _get_params(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
@ -38,7 +39,3 @@ class likelihood:
|
||||||
|
|
||||||
def predictive_values(self, mu, var):
|
def predictive_values(self, mu, var):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def copy(self):
|
|
||||||
""" Returns a (deep) copy of the current likelihood """
|
|
||||||
return copy.deepcopy(self)
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ def binomial(gp_link=None):
|
||||||
analytical_mean = True
|
analytical_mean = True
|
||||||
analytical_variance = False
|
analytical_variance = False
|
||||||
|
|
||||||
elif isinstance(gp_link,noise_models.gp_transformations.Step):
|
elif isinstance(gp_link,noise_models.gp_transformations.Heaviside):
|
||||||
analytical_mean = True
|
analytical_mean = True
|
||||||
analytical_variance = True
|
analytical_variance = True
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ def exponential(gp_link=None):
|
||||||
analytical_variance = False
|
analytical_variance = False
|
||||||
return noise_models.exponential_noise.Exponential(gp_link,analytical_mean,analytical_variance)
|
return noise_models.exponential_noise.Exponential(gp_link,analytical_mean,analytical_variance)
|
||||||
|
|
||||||
def gaussian(gp_link=None,variance=1.):
|
def gaussian_ep(gp_link=None,variance=1.):
|
||||||
"""
|
"""
|
||||||
Construct a gaussian likelihood
|
Construct a gaussian likelihood
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,15 +49,30 @@ class Binomial(NoiseDistribution):
|
||||||
mu_hat = v_i/tau_i + data_i*phi/(Z_hat*np.sqrt(tau_i**2 + tau_i))
|
mu_hat = v_i/tau_i + data_i*phi/(Z_hat*np.sqrt(tau_i**2 + tau_i))
|
||||||
sigma2_hat = 1./tau_i - (phi/((tau_i**2+tau_i)*Z_hat))*(z+phi/Z_hat)
|
sigma2_hat = 1./tau_i - (phi/((tau_i**2+tau_i)*Z_hat))*(z+phi/Z_hat)
|
||||||
|
|
||||||
elif isinstance(self.gp_link,gp_transformations.Step):
|
elif isinstance(self.gp_link,gp_transformations.Heaviside):
|
||||||
Z_hat = None
|
a = data_i*v_i/np.sqrt(tau_i)
|
||||||
mu_hat = None
|
Z_hat = std_norm_cdf(a)
|
||||||
sigma2_hat = None
|
N = std_norm_pdf(a)
|
||||||
|
mu_hat = v_i/tau_i + data_i*N/Z_hat/np.sqrt(tau_i)
|
||||||
|
sigma2_hat = (1. - a*N/Z_hat - np.square(N/Z_hat))/tau_i
|
||||||
|
if np.any(np.isnan([Z_hat, mu_hat, sigma2_hat])):
|
||||||
|
stop
|
||||||
|
|
||||||
return Z_hat, mu_hat, sigma2_hat
|
return Z_hat, mu_hat, sigma2_hat
|
||||||
|
|
||||||
def _predictive_mean_analytical(self,mu,sigma):
|
def _predictive_mean_analytical(self,mu,sigma):
|
||||||
|
if isinstance(self.gp_link,gp_transformations.Probit):
|
||||||
return stats.norm.cdf(mu/np.sqrt(1+sigma**2))
|
return stats.norm.cdf(mu/np.sqrt(1+sigma**2))
|
||||||
|
elif isinstance(self.gp_link,gp_transformations.Heaviside):
|
||||||
|
return stats.norm.cdf(mu/sigma)
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def _predictive_variance_analytical(self,mu,sigma, pred_mean):
|
||||||
|
if isinstance(self.gp_link,gp_transformations.Heaviside):
|
||||||
|
return 0.
|
||||||
|
else:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def _mass(self,gp,obs):
|
def _mass(self,gp,obs):
|
||||||
#NOTE obs must be in {0,1}
|
#NOTE obs must be in {0,1}
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ class Reciprocal(GPTransformation):
|
||||||
def d2transf_df2(self,f):
|
def d2transf_df2(self,f):
|
||||||
return 2./f**3
|
return 2./f**3
|
||||||
|
|
||||||
class Step(GPTransformation):
|
class Heaviside(GPTransformation):
|
||||||
"""
|
"""
|
||||||
$$
|
$$
|
||||||
g(f) = I_{x \in A}
|
g(f) = I_{x \in A}
|
||||||
|
|
@ -116,10 +116,10 @@ class Step(GPTransformation):
|
||||||
"""
|
"""
|
||||||
def transf(self,f):
|
def transf(self,f):
|
||||||
#transformation goes here
|
#transformation goes here
|
||||||
return np.where(f>0, 1, -1)
|
return np.where(f>0, 1, 0)
|
||||||
|
|
||||||
def dtransf_df(self,f):
|
def dtransf_df(self,f):
|
||||||
pass
|
raise NotImplementedError, "This function is not differentiable!"
|
||||||
|
|
||||||
def d2transf_df2(self,f):
|
def d2transf_df2(self,f):
|
||||||
pass
|
raise NotImplementedError, "This function is not differentiable!"
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ class NoiseDistribution(object):
|
||||||
:param mu: cavity distribution mean
|
:param mu: cavity distribution mean
|
||||||
:param sigma: cavity distribution standard deviation
|
:param sigma: cavity distribution standard deviation
|
||||||
"""
|
"""
|
||||||
return sp.optimize.fmin_ncg(self._nlog_product_scaled,x0=mu,fprime=self._dnlog_product_dgp,fhess=self._d2nlog_product_dgp2,args=(obs,mu,sigma))
|
return sp.optimize.fmin_ncg(self._nlog_product_scaled,x0=mu,fprime=self._dnlog_product_dgp,fhess=self._d2nlog_product_dgp2,args=(obs,mu,sigma),disp=False)
|
||||||
|
|
||||||
def _moments_match_analytical(self,obs,tau,v):
|
def _moments_match_analytical(self,obs,tau,v):
|
||||||
"""
|
"""
|
||||||
|
|
@ -244,7 +244,7 @@ class NoiseDistribution(object):
|
||||||
:param mu: cavity distribution mean
|
:param mu: cavity distribution mean
|
||||||
:param sigma: cavity distribution standard deviation
|
:param sigma: cavity distribution standard deviation
|
||||||
"""
|
"""
|
||||||
maximum = sp.optimize.fmin_ncg(self._nlog_conditional_mean_scaled,x0=self._mean(mu),fprime=self._dnlog_conditional_mean_dgp,fhess=self._d2nlog_conditional_mean_dgp2,args=(mu,sigma))
|
maximum = sp.optimize.fmin_ncg(self._nlog_conditional_mean_scaled,x0=self._mean(mu),fprime=self._dnlog_conditional_mean_dgp,fhess=self._d2nlog_conditional_mean_dgp2,args=(mu,sigma),disp=False)
|
||||||
mean = np.exp(-self._nlog_conditional_mean_scaled(maximum,mu,sigma))/(np.sqrt(self._d2nlog_conditional_mean_dgp2(maximum,mu,sigma))*sigma)
|
mean = np.exp(-self._nlog_conditional_mean_scaled(maximum,mu,sigma))/(np.sqrt(self._d2nlog_conditional_mean_dgp2(maximum,mu,sigma))*sigma)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -267,7 +267,7 @@ class NoiseDistribution(object):
|
||||||
:param mu: cavity distribution mean
|
:param mu: cavity distribution mean
|
||||||
:param sigma: cavity distribution standard deviation
|
:param sigma: cavity distribution standard deviation
|
||||||
"""
|
"""
|
||||||
maximum = sp.optimize.fmin_ncg(self._nlog_exp_conditional_mean_sq_scaled,x0=self._mean(mu),fprime=self._dnlog_exp_conditional_mean_sq_dgp,fhess=self._d2nlog_exp_conditional_mean_sq_dgp2,args=(mu,sigma))
|
maximum = sp.optimize.fmin_ncg(self._nlog_exp_conditional_mean_sq_scaled,x0=self._mean(mu),fprime=self._dnlog_exp_conditional_mean_sq_dgp,fhess=self._d2nlog_exp_conditional_mean_sq_dgp2,args=(mu,sigma),disp=False)
|
||||||
mean_squared = np.exp(-self._nlog_exp_conditional_mean_sq_scaled(maximum,mu,sigma))/(np.sqrt(self._d2nlog_exp_conditional_mean_sq_dgp2(maximum,mu,sigma))*sigma)
|
mean_squared = np.exp(-self._nlog_exp_conditional_mean_sq_scaled(maximum,mu,sigma))/(np.sqrt(self._d2nlog_exp_conditional_mean_sq_dgp2(maximum,mu,sigma))*sigma)
|
||||||
return mean_squared
|
return mean_squared
|
||||||
|
|
||||||
|
|
@ -280,7 +280,7 @@ class NoiseDistribution(object):
|
||||||
:predictive_mean: output's predictive mean, if None _predictive_mean function will be called.
|
:predictive_mean: output's predictive mean, if None _predictive_mean function will be called.
|
||||||
"""
|
"""
|
||||||
# E( V(Y_star|f_star) )
|
# E( V(Y_star|f_star) )
|
||||||
maximum = sp.optimize.fmin_ncg(self._nlog_exp_conditional_variance_scaled,x0=self._variance(mu),fprime=self._dnlog_exp_conditional_variance_dgp,fhess=self._d2nlog_exp_conditional_variance_dgp2,args=(mu,sigma))
|
maximum = sp.optimize.fmin_ncg(self._nlog_exp_conditional_variance_scaled,x0=self._variance(mu),fprime=self._dnlog_exp_conditional_variance_dgp,fhess=self._d2nlog_exp_conditional_variance_dgp2,args=(mu,sigma),disp=False)
|
||||||
exp_var = np.exp(-self._nlog_exp_conditional_variance_scaled(maximum,mu,sigma))/(np.sqrt(self._d2nlog_exp_conditional_variance_dgp2(maximum,mu,sigma))*sigma)
|
exp_var = np.exp(-self._nlog_exp_conditional_variance_scaled(maximum,mu,sigma))/(np.sqrt(self._d2nlog_exp_conditional_variance_dgp2(maximum,mu,sigma))*sigma)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
@ -357,7 +357,7 @@ class NoiseDistribution(object):
|
||||||
:param mu: latent variable's predictive mean
|
:param mu: latent variable's predictive mean
|
||||||
:param sigma: latent variable's predictive standard deviation
|
:param sigma: latent variable's predictive standard deviation
|
||||||
"""
|
"""
|
||||||
return sp.optimize.fmin_ncg(self._nlog_joint_predictive_scaled,x0=(mu,self.gp_link.transf(mu)),fprime=self._gradient_nlog_joint_predictive,fhess=self._hessian_nlog_joint_predictive,args=(mu,sigma))
|
return sp.optimize.fmin_ncg(self._nlog_joint_predictive_scaled,x0=(mu,self.gp_link.transf(mu)),fprime=self._gradient_nlog_joint_predictive,fhess=self._hessian_nlog_joint_predictive,args=(mu,sigma),disp=False)
|
||||||
|
|
||||||
def predictive_values(self,mu,var):
|
def predictive_values(self,mu,var):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from .. import kern
|
||||||
import itertools
|
import itertools
|
||||||
from matplotlib.colors import colorConverter
|
from matplotlib.colors import colorConverter
|
||||||
from GPy.inference.optimization import SCG
|
from GPy.inference.optimization import SCG
|
||||||
from GPy.util import plot_latent
|
from GPy.util import plot_latent, linalg
|
||||||
from GPy.models.gplvm import GPLVM
|
from GPy.models.gplvm import GPLVM
|
||||||
from GPy.util.plot_latent import most_significant_input_dimensions
|
from GPy.util.plot_latent import most_significant_input_dimensions
|
||||||
from matplotlib import pyplot
|
from matplotlib import pyplot
|
||||||
|
|
@ -66,8 +66,8 @@ class BayesianGPLVM(SparseGP, GPLVM):
|
||||||
S_names = sum([['X_variance_%i_%i' % (n, q) for q in range(self.input_dim)] for n in range(self.num_data)], [])
|
S_names = sum([['X_variance_%i_%i' % (n, q) for q in range(self.input_dim)] for n in range(self.num_data)], [])
|
||||||
return (X_names + S_names + SparseGP._get_param_names(self))
|
return (X_names + S_names + SparseGP._get_param_names(self))
|
||||||
|
|
||||||
def _get_print_names(self):
|
#def _get_print_names(self):
|
||||||
return SparseGP._get_print_names(self)
|
# return SparseGP._get_print_names(self)
|
||||||
|
|
||||||
def _get_params(self):
|
def _get_params(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -140,12 +140,20 @@ class BayesianGPLVM(SparseGP, GPLVM):
|
||||||
dpsi0 = -0.5 * self.input_dim * self.likelihood.precision
|
dpsi0 = -0.5 * self.input_dim * self.likelihood.precision
|
||||||
dpsi2 = self.dL_dpsi2[0][None, :, :] # TODO: this may change if we ignore het. likelihoods
|
dpsi2 = self.dL_dpsi2[0][None, :, :] # TODO: this may change if we ignore het. likelihoods
|
||||||
V = self.likelihood.precision * Y
|
V = self.likelihood.precision * Y
|
||||||
|
|
||||||
|
#compute CPsi1V
|
||||||
|
if self.Cpsi1V is None:
|
||||||
|
psi1V = np.dot(self.psi1.T, self.likelihood.V)
|
||||||
|
tmp, _ = linalg.dtrtrs(self._Lm, np.asfortranarray(psi1V), lower=1, trans=0)
|
||||||
|
tmp, _ = linalg.dpotrs(self.LB, tmp, lower=1)
|
||||||
|
self.Cpsi1V, _ = linalg.dtrtrs(self._Lm, tmp, lower=1, trans=1)
|
||||||
|
|
||||||
dpsi1 = np.dot(self.Cpsi1V, V.T)
|
dpsi1 = np.dot(self.Cpsi1V, V.T)
|
||||||
|
|
||||||
start = np.zeros(self.input_dim * 2)
|
start = np.zeros(self.input_dim * 2)
|
||||||
|
|
||||||
for n, dpsi1_n in enumerate(dpsi1.T[:, :, None]):
|
for n, dpsi1_n in enumerate(dpsi1.T[:, :, None]):
|
||||||
args = (self.kern, self.Z, dpsi0, dpsi1_n, dpsi2)
|
args = (self.kern, self.Z, dpsi0, dpsi1_n.T, dpsi2)
|
||||||
xopt, fopt, neval, status = SCG(f=latent_cost, gradf=latent_grad, x=start, optargs=args, display=False)
|
xopt, fopt, neval, status = SCG(f=latent_cost, gradf=latent_grad, x=start, optargs=args, display=False)
|
||||||
|
|
||||||
mu, log_S = xopt.reshape(2, 1, -1)
|
mu, log_S = xopt.reshape(2, 1, -1)
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class GPClassification(GP):
|
||||||
This is a thin wrapper around the models.GP class, with a set of sensible defaults
|
This is a thin wrapper around the models.GP class, with a set of sensible defaults
|
||||||
|
|
||||||
:param X: input observations
|
:param X: input observations
|
||||||
:param Y: observed values
|
:param Y: observed values, can be None if likelihood is not None
|
||||||
:param likelihood: a GPy likelihood, defaults to Binomial with probit link_function
|
:param likelihood: a GPy likelihood, defaults to Binomial with probit link_function
|
||||||
:param kernel: a GPy kernel, defaults to rbf
|
:param kernel: a GPy kernel, defaults to rbf
|
||||||
:param normalize_X: whether to normalize the input data before computing (predictions will be in original scales)
|
:param normalize_X: whether to normalize the input data before computing (predictions will be in original scales)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import numpy as np
|
||||||
from ..core import GP
|
from ..core import GP
|
||||||
from .. import likelihoods
|
from .. import likelihoods
|
||||||
from .. import kern
|
from .. import kern
|
||||||
#from ..util import multioutput
|
|
||||||
|
|
||||||
class GPMultioutputRegression(GP):
|
class GPMultioutputRegression(GP):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -163,28 +163,31 @@ class MRD(Model):
|
||||||
self._init_X(initx, self.likelihood_list)
|
self._init_X(initx, self.likelihood_list)
|
||||||
self._init_Z(initz, self.X)
|
self._init_Z(initz, self.X)
|
||||||
|
|
||||||
def _get_latent_param_names(self):
|
#def _get_latent_param_names(self):
|
||||||
|
def _get_param_names(self):
|
||||||
n1 = self.gref._get_param_names()
|
n1 = self.gref._get_param_names()
|
||||||
n1var = n1[:self.NQ * 2 + self.MQ]
|
n1var = n1[:self.NQ * 2 + self.MQ]
|
||||||
return n1var
|
# return n1var
|
||||||
|
#
|
||||||
|
#def _get_kernel_names(self):
|
||||||
def _get_kernel_names(self):
|
|
||||||
map_names = lambda ns, name: map(lambda x: "{1}_{0}".format(*x),
|
map_names = lambda ns, name: map(lambda x: "{1}_{0}".format(*x),
|
||||||
itertools.izip(ns,
|
itertools.izip(ns,
|
||||||
itertools.repeat(name)))
|
itertools.repeat(name)))
|
||||||
kernel_names = (map_names(SparseGP._get_param_names(g)[self.MQ:], n) for g, n in zip(self.bgplvms, self.names))
|
return list(itertools.chain(n1var, *(map_names(\
|
||||||
return kernel_names
|
SparseGP._get_param_names(g)[self.MQ:], n) \
|
||||||
|
for g, n in zip(self.bgplvms, self.names))))
|
||||||
|
# kernel_names = (map_names(SparseGP._get_param_names(g)[self.MQ:], n) for g, n in zip(self.bgplvms, self.names))
|
||||||
|
# return kernel_names
|
||||||
|
|
||||||
def _get_param_names(self):
|
#def _get_param_names(self):
|
||||||
# X_names = sum([['X_%i_%i' % (n, q) for q in range(self.input_dim)] for n in range(self.num_data)], [])
|
# X_names = sum([['X_%i_%i' % (n, q) for q in range(self.input_dim)] for n in range(self.num_data)], [])
|
||||||
# S_names = sum([['X_variance_%i_%i' % (n, q) for q in range(self.input_dim)] for n in range(self.num_data)], [])
|
# S_names = sum([['X_variance_%i_%i' % (n, q) for q in range(self.input_dim)] for n in range(self.num_data)], [])
|
||||||
n1var = self._get_latent_param_names()
|
# n1var = self._get_latent_param_names()
|
||||||
kernel_names = self._get_kernel_names()
|
# kernel_names = self._get_kernel_names()
|
||||||
return list(itertools.chain(n1var, *kernel_names))
|
# return list(itertools.chain(n1var, *kernel_names))
|
||||||
|
|
||||||
def _get_print_names(self):
|
#def _get_print_names(self):
|
||||||
return list(itertools.chain(*self._get_kernel_names()))
|
# return list(itertools.chain(*self._get_kernel_names()))
|
||||||
|
|
||||||
def _get_params(self):
|
def _get_params(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ class KernelTests(unittest.TestCase):
|
||||||
kern = GPy.kern.poly(5, degree=4)
|
kern = GPy.kern.poly(5, degree=4)
|
||||||
self.assertTrue(GPy.kern.kern_test(kern, verbose=verbose))
|
self.assertTrue(GPy.kern.kern_test(kern, verbose=verbose))
|
||||||
|
|
||||||
def test_coregionalisation(self):
|
def test_coregionalization(self):
|
||||||
X1 = np.random.rand(50,1)*8
|
X1 = np.random.rand(50,1)*8
|
||||||
X2 = np.random.rand(30,1)*5
|
X2 = np.random.rand(30,1)*5
|
||||||
index = np.vstack((np.zeros_like(X1),np.ones_like(X2)))
|
index = np.vstack((np.zeros_like(X1),np.ones_like(X2)))
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,3 @@ import visualize
|
||||||
import decorators
|
import decorators
|
||||||
import classification
|
import classification
|
||||||
import latent_space_visualizations
|
import latent_space_visualizations
|
||||||
#import multioutput
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ def dpotri(A, lower=0):
|
||||||
|
|
||||||
:param A: Matrix A
|
:param A: Matrix A
|
||||||
:param lower: is matrix lower (true) or upper (false)
|
:param lower: is matrix lower (true) or upper (false)
|
||||||
:returns:
|
:returns: A inverse
|
||||||
"""
|
"""
|
||||||
return lapack.dpotri(A, lower=lower)
|
return lapack.dpotri(A, lower=lower)
|
||||||
|
|
||||||
|
|
|
||||||
49
README.md
49
README.md
|
|
@ -1,10 +1,57 @@
|
||||||
GPy
|
GPy
|
||||||
===
|
===
|
||||||
|
|
||||||
A Gaussian processes framework in python
|
A Gaussian processes framework in Python.
|
||||||
|
|
||||||
* [Online documentation](https://gpy.readthedocs.org/en/latest/)
|
* [Online documentation](https://gpy.readthedocs.org/en/latest/)
|
||||||
* [Unit tests (Travis-CI)](https://travis-ci.org/SheffieldML/GPy)
|
* [Unit tests (Travis-CI)](https://travis-ci.org/SheffieldML/GPy)
|
||||||
|
|
||||||
|
|
||||||
Continuous integration status: 
|
Continuous integration status: 
|
||||||
|
|
||||||
|
|
||||||
|
Compiling documentation:
|
||||||
|
========================
|
||||||
|
|
||||||
|
The documentation is stored in doc/ and is compiled with the Sphinx Python documentation generator, and is written in the reStructuredText format.
|
||||||
|
|
||||||
|
The Sphinx documentation is available here: http://sphinx-doc.org/latest/contents.html
|
||||||
|
|
||||||
|
|
||||||
|
Installing dependencies:
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
To compile the documentation, first ensure that Sphinx is installed. On Debian-based systems, this can be achieved as follows:
|
||||||
|
|
||||||
|
sudo apt-get install python-pip
|
||||||
|
sudo pip install sphinx
|
||||||
|
|
||||||
|
A LaTeX distribution is also required to compile the equations. Note that the extra packages are necessary to install the unicode packages. To compile the equations to PNG format for use in HTML pages, the package *dvipng* must be installed. IPython is also required. On Debian-based systems, this can be achieved as follows:
|
||||||
|
|
||||||
|
sudo apt-get install texlive texlive-latex-extra texlive-base texlive-recommended
|
||||||
|
sudo apt-get install dvipng
|
||||||
|
sudo apt-get install ipython
|
||||||
|
|
||||||
|
|
||||||
|
Compiling documentation:
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
The documentation can be compiled as follows:
|
||||||
|
|
||||||
|
cd doc
|
||||||
|
make html
|
||||||
|
|
||||||
|
The HTML files are then stored in doc/_build/
|
||||||
|
|
||||||
|
|
||||||
|
Running unit tests:
|
||||||
|
===================
|
||||||
|
|
||||||
|
Ensure nose is installed via pip:
|
||||||
|
|
||||||
|
pip install nose
|
||||||
|
|
||||||
|
Run nosetests from the root directory of the repository:
|
||||||
|
|
||||||
|
nosetests -v
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,91 +1,102 @@
|
||||||
core Package
|
GPy.core package
|
||||||
============
|
================
|
||||||
|
|
||||||
:mod:`core` Package
|
Submodules
|
||||||
-------------------
|
----------
|
||||||
|
|
||||||
.. automodule:: GPy.core
|
GPy.core.domains module
|
||||||
:members:
|
-----------------------
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`domains` Module
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.core.domains
|
.. automodule:: GPy.core.domains
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`fitc` Module
|
GPy.core.fitc module
|
||||||
------------------
|
--------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.fitc
|
.. automodule:: GPy.core.fitc
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`gp` Module
|
GPy.core.gp module
|
||||||
----------------
|
------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.gp
|
.. automodule:: GPy.core.gp
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`gp_base` Module
|
GPy.core.gp_base module
|
||||||
---------------------
|
-----------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.gp_base
|
.. automodule:: GPy.core.gp_base
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`model` Module
|
GPy.core.mapping module
|
||||||
-------------------
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.core.mapping
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.core.model module
|
||||||
|
---------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.model
|
.. automodule:: GPy.core.model
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`parameterized` Module
|
GPy.core.parameterized module
|
||||||
---------------------------
|
-----------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.parameterized
|
.. automodule:: GPy.core.parameterized
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`priors` Module
|
GPy.core.priors module
|
||||||
--------------------
|
----------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.priors
|
.. automodule:: GPy.core.priors
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`sparse_gp` Module
|
GPy.core.sparse_gp module
|
||||||
-----------------------
|
-------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.sparse_gp
|
.. automodule:: GPy.core.sparse_gp
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`svigp` Module
|
GPy.core.svigp module
|
||||||
-------------------
|
---------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.svigp
|
.. automodule:: GPy.core.svigp
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`transformations` Module
|
GPy.core.transformations module
|
||||||
-----------------------------
|
-------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.core.transformations
|
.. automodule:: GPy.core.transformations
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.core
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,54 @@
|
||||||
examples Package
|
GPy.examples package
|
||||||
================
|
====================
|
||||||
|
|
||||||
:mod:`examples` Package
|
Submodules
|
||||||
-----------------------
|
----------
|
||||||
|
|
||||||
.. automodule:: GPy.examples
|
GPy.examples.classification module
|
||||||
:members:
|
----------------------------------
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`classification` Module
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.examples.classification
|
.. automodule:: GPy.examples.classification
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`dimensionality_reduction` Module
|
GPy.examples.dimensionality_reduction module
|
||||||
--------------------------------------
|
--------------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.examples.dimensionality_reduction
|
.. automodule:: GPy.examples.dimensionality_reduction
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`regression` Module
|
GPy.examples.regression module
|
||||||
------------------------
|
------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.examples.regression
|
.. automodule:: GPy.examples.regression
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`stochastic` Module
|
GPy.examples.stochastic module
|
||||||
------------------------
|
------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.examples.stochastic
|
.. automodule:: GPy.examples.stochastic
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`tutorials` Module
|
GPy.examples.tutorials module
|
||||||
-----------------------
|
-----------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.examples.tutorials
|
.. automodule:: GPy.examples.tutorials
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.examples
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,62 @@
|
||||||
inference Package
|
GPy.inference package
|
||||||
=================
|
=====================
|
||||||
|
|
||||||
:mod:`conjugate_gradient_descent` Module
|
Submodules
|
||||||
----------------------------------------
|
----------
|
||||||
|
|
||||||
|
GPy.inference.conjugate_gradient_descent module
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.inference.conjugate_gradient_descent
|
.. automodule:: GPy.inference.conjugate_gradient_descent
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`gradient_descent_update_rules` Module
|
GPy.inference.gradient_descent_update_rules module
|
||||||
-------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.inference.gradient_descent_update_rules
|
.. automodule:: GPy.inference.gradient_descent_update_rules
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`optimization` Module
|
GPy.inference.optimization module
|
||||||
--------------------------
|
---------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.inference.optimization
|
.. automodule:: GPy.inference.optimization
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`samplers` Module
|
GPy.inference.samplers module
|
||||||
----------------------
|
-----------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.inference.samplers
|
.. automodule:: GPy.inference.samplers
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`scg` Module
|
GPy.inference.scg module
|
||||||
-----------------
|
------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.inference.scg
|
.. automodule:: GPy.inference.scg
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`sgd` Module
|
GPy.inference.sgd module
|
||||||
-----------------
|
------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.inference.sgd
|
.. automodule:: GPy.inference.sgd
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.inference
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
|
||||||
246
doc/GPy.kern.parts.rst
Normal file
246
doc/GPy.kern.parts.rst
Normal file
|
|
@ -0,0 +1,246 @@
|
||||||
|
GPy.kern.parts package
|
||||||
|
======================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
GPy.kern.parts.Brownian module
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.Brownian
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.Matern32 module
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.Matern32
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.Matern52 module
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.Matern52
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.bias module
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.bias
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.coregionalize module
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.coregionalize
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.exponential module
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.exponential
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.finite_dimensional module
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.finite_dimensional
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.fixed module
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.fixed
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.gibbs module
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.gibbs
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.hetero module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.hetero
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.hierarchical module
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.hierarchical
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.independent_outputs module
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.independent_outputs
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.kernpart module
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.kernpart
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.linear module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.linear
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.mlp module
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.mlp
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.periodic_Matern32 module
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.periodic_Matern32
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.periodic_Matern52 module
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.periodic_Matern52
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.periodic_exponential module
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.periodic_exponential
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.poly module
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.poly
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.prod module
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.prod
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.prod_orthogonal module
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.prod_orthogonal
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.rational_quadratic module
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.rational_quadratic
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.rbf module
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.rbf
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.rbf_inv module
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.rbf_inv
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.rbfcos module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.rbfcos
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.spline module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.spline
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.symmetric module
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.symmetric
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.sympykern module
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.sympykern
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.parts.white module
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts.white
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.parts
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
@ -1,29 +1,5 @@
|
||||||
kern Package
|
GPy.kern package
|
||||||
============
|
================
|
||||||
|
|
||||||
:mod:`kern` Package
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.kern
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`constructors` Module
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.kern.constructors
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`kern` Module
|
|
||||||
------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.kern.kern
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
Subpackages
|
Subpackages
|
||||||
-----------
|
-----------
|
||||||
|
|
@ -32,3 +8,30 @@ Subpackages
|
||||||
|
|
||||||
GPy.kern.parts
|
GPy.kern.parts
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
GPy.kern.constructors module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.constructors
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.kern.kern module
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern.kern
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.kern
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
|
||||||
70
doc/GPy.likelihoods.noise_models.rst
Normal file
70
doc/GPy.likelihoods.noise_models.rst
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
GPy.likelihoods.noise_models package
|
||||||
|
====================================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
GPy.likelihoods.noise_models.binomial_noise module
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.noise_models.binomial_noise
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.likelihoods.noise_models.exponential_noise module
|
||||||
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.noise_models.exponential_noise
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.likelihoods.noise_models.gamma_noise module
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.noise_models.gamma_noise
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.likelihoods.noise_models.gaussian_noise module
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.noise_models.gaussian_noise
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.likelihoods.noise_models.gp_transformations module
|
||||||
|
------------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.noise_models.gp_transformations
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.likelihoods.noise_models.noise_distributions module
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.noise_models.noise_distributions
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.likelihoods.noise_models.poisson_noise module
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.noise_models.poisson_noise
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.noise_models
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
@ -1,51 +1,69 @@
|
||||||
likelihoods Package
|
GPy.likelihoods package
|
||||||
===================
|
=======================
|
||||||
|
|
||||||
:mod:`likelihoods` Package
|
Subpackages
|
||||||
--------------------------
|
-----------
|
||||||
|
|
||||||
.. automodule:: GPy.likelihoods
|
.. toctree::
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`ep` Module
|
GPy.likelihoods.noise_models
|
||||||
----------------
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
GPy.likelihoods.ep module
|
||||||
|
-------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.likelihoods.ep
|
.. automodule:: GPy.likelihoods.ep
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`gaussian` Module
|
GPy.likelihoods.ep_mixed_noise module
|
||||||
----------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.ep_mixed_noise
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.likelihoods.gaussian module
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.likelihoods.gaussian
|
.. automodule:: GPy.likelihoods.gaussian
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`likelihood` Module
|
GPy.likelihoods.gaussian_mixed_noise module
|
||||||
------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods.gaussian_mixed_noise
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.likelihoods.likelihood module
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.likelihoods.likelihood
|
.. automodule:: GPy.likelihoods.likelihood
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`likelihood_functions` Module
|
GPy.likelihoods.noise_model_constructors module
|
||||||
----------------------------------
|
-----------------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.likelihoods.likelihood_functions
|
.. automodule:: GPy.likelihoods.noise_model_constructors
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`link_functions` Module
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.likelihoods.link_functions
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.likelihoods
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
|
||||||
38
doc/GPy.mappings.rst
Normal file
38
doc/GPy.mappings.rst
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
GPy.mappings package
|
||||||
|
====================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
GPy.mappings.kernel module
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.mappings.kernel
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.mappings.linear module
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.mappings.linear
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.mappings.mlp module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.mappings.mlp
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.mappings
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
@ -1,99 +1,134 @@
|
||||||
models Package
|
GPy.models package
|
||||||
==============
|
==================
|
||||||
|
|
||||||
:mod:`models` Package
|
Submodules
|
||||||
---------------------
|
----------
|
||||||
|
|
||||||
.. automodule:: GPy.models
|
GPy.models.bayesian_gplvm module
|
||||||
:members:
|
--------------------------------
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`bayesian_gplvm` Module
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.models.bayesian_gplvm
|
.. automodule:: GPy.models.bayesian_gplvm
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`fitc_classification` Module
|
GPy.models.bcgplvm module
|
||||||
---------------------------------
|
-------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.models.bcgplvm
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.models.fitc_classification module
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.fitc_classification
|
.. automodule:: GPy.models.fitc_classification
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`gp_classification` Module
|
GPy.models.gp_classification module
|
||||||
-------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.gp_classification
|
.. automodule:: GPy.models.gp_classification
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`gp_regression` Module
|
GPy.models.gp_multioutput_regression module
|
||||||
---------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.models.gp_multioutput_regression
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.models.gp_regression module
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.gp_regression
|
.. automodule:: GPy.models.gp_regression
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`gplvm` Module
|
GPy.models.gplvm module
|
||||||
-------------------
|
-----------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.gplvm
|
.. automodule:: GPy.models.gplvm
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`mrd` Module
|
GPy.models.gradient_checker module
|
||||||
-----------------
|
----------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.models.gradient_checker
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.models.mrd module
|
||||||
|
---------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.mrd
|
.. automodule:: GPy.models.mrd
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`sparse_gp_classification` Module
|
GPy.models.sparse_gp_classification module
|
||||||
--------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.sparse_gp_classification
|
.. automodule:: GPy.models.sparse_gp_classification
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`sparse_gp_regression` Module
|
GPy.models.sparse_gp_multioutput_regression module
|
||||||
----------------------------------
|
--------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.models.sparse_gp_multioutput_regression
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.models.sparse_gp_regression module
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.sparse_gp_regression
|
.. automodule:: GPy.models.sparse_gp_regression
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`sparse_gplvm` Module
|
GPy.models.sparse_gplvm module
|
||||||
--------------------------
|
------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.sparse_gplvm
|
.. automodule:: GPy.models.sparse_gplvm
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`svigp_regression` Module
|
GPy.models.svigp_regression module
|
||||||
------------------------------
|
----------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.svigp_regression
|
.. automodule:: GPy.models.svigp_regression
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`warped_gp` Module
|
GPy.models.warped_gp module
|
||||||
-----------------------
|
---------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.models.warped_gp
|
.. automodule:: GPy.models.warped_gp
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.models
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
|
||||||
18
doc/GPy.rst
18
doc/GPy.rst
|
|
@ -1,14 +1,6 @@
|
||||||
GPy Package
|
GPy package
|
||||||
===========
|
===========
|
||||||
|
|
||||||
:mod:`GPy` Package
|
|
||||||
------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.__init__
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
Subpackages
|
Subpackages
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
@ -19,7 +11,15 @@ Subpackages
|
||||||
GPy.inference
|
GPy.inference
|
||||||
GPy.kern
|
GPy.kern
|
||||||
GPy.likelihoods
|
GPy.likelihoods
|
||||||
|
GPy.mappings
|
||||||
GPy.models
|
GPy.models
|
||||||
GPy.testing
|
GPy.testing
|
||||||
GPy.util
|
GPy.util
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
|
||||||
|
|
@ -1,107 +1,110 @@
|
||||||
testing Package
|
GPy.testing package
|
||||||
===============
|
===================
|
||||||
|
|
||||||
:mod:`testing` Package
|
Submodules
|
||||||
----------------------
|
----------
|
||||||
|
|
||||||
.. automodule:: GPy.testing
|
GPy.testing.bgplvm_tests module
|
||||||
:members:
|
-------------------------------
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`bgplvm_tests` Module
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.testing.bgplvm_tests
|
.. automodule:: GPy.testing.bgplvm_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`cgd_tests` Module
|
GPy.testing.cgd_tests module
|
||||||
-----------------------
|
----------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.cgd_tests
|
.. automodule:: GPy.testing.cgd_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`checkgrad` Module
|
GPy.testing.examples_tests module
|
||||||
-----------------------
|
---------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.checkgrad
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`examples_tests` Module
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
.. automodule:: GPy.testing.examples_tests
|
.. automodule:: GPy.testing.examples_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`gplvm_tests` Module
|
GPy.testing.gplvm_tests module
|
||||||
-------------------------
|
------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.gplvm_tests
|
.. automodule:: GPy.testing.gplvm_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`kernel_tests` Module
|
GPy.testing.kernel_tests module
|
||||||
--------------------------
|
-------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.kernel_tests
|
.. automodule:: GPy.testing.kernel_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`mrd_tests` Module
|
GPy.testing.mapping_tests module
|
||||||
-----------------------
|
--------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.testing.mapping_tests
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.testing.mrd_tests module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.mrd_tests
|
.. automodule:: GPy.testing.mrd_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`prior_tests` Module
|
GPy.testing.prior_tests module
|
||||||
-------------------------
|
------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.prior_tests
|
.. automodule:: GPy.testing.prior_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`psi_stat_expactation_tests` Module
|
GPy.testing.psi_stat_expectation_tests module
|
||||||
----------------------------------------
|
---------------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.psi_stat_expactation_tests
|
.. automodule:: GPy.testing.psi_stat_expectation_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`psi_stat_gradient_tests` Module
|
GPy.testing.psi_stat_gradient_tests module
|
||||||
-------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.psi_stat_gradient_tests
|
.. automodule:: GPy.testing.psi_stat_gradient_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`sparse_gplvm_tests` Module
|
GPy.testing.sparse_gplvm_tests module
|
||||||
--------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.sparse_gplvm_tests
|
.. automodule:: GPy.testing.sparse_gplvm_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`unit_tests` Module
|
GPy.testing.unit_tests module
|
||||||
------------------------
|
-----------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.testing.unit_tests
|
.. automodule:: GPy.testing.unit_tests
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.testing
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
|
||||||
30
doc/GPy.util.latent_space_visualizations.controllers.rst
Normal file
30
doc/GPy.util.latent_space_visualizations.controllers.rst
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
GPy.util.latent_space_visualizations.controllers package
|
||||||
|
========================================================
|
||||||
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
GPy.util.latent_space_visualizations.controllers.axis_event_controller module
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.util.latent_space_visualizations.controllers.axis_event_controller
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
GPy.util.latent_space_visualizations.controllers.imshow_controller module
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.util.latent_space_visualizations.controllers.imshow_controller
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.util.latent_space_visualizations.controllers
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
17
doc/GPy.util.latent_space_visualizations.rst
Normal file
17
doc/GPy.util.latent_space_visualizations.rst
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
GPy.util.latent_space_visualizations package
|
||||||
|
============================================
|
||||||
|
|
||||||
|
Subpackages
|
||||||
|
-----------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
GPy.util.latent_space_visualizations.controllers
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.util.latent_space_visualizations
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
@ -1,123 +1,133 @@
|
||||||
util Package
|
GPy.util package
|
||||||
============
|
================
|
||||||
|
|
||||||
:mod:`util` Package
|
Subpackages
|
||||||
-------------------
|
-----------
|
||||||
|
|
||||||
.. automodule:: GPy.util
|
.. toctree::
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
:mod:`Tango` Module
|
GPy.util.latent_space_visualizations
|
||||||
-------------------
|
|
||||||
|
Submodules
|
||||||
|
----------
|
||||||
|
|
||||||
|
GPy.util.Tango module
|
||||||
|
---------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.Tango
|
.. automodule:: GPy.util.Tango
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`classification` Module
|
GPy.util.classification module
|
||||||
----------------------------
|
------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.classification
|
.. automodule:: GPy.util.classification
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`datasets` Module
|
GPy.util.datasets module
|
||||||
----------------------
|
------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.datasets
|
.. automodule:: GPy.util.datasets
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`decorators` Module
|
GPy.util.decorators module
|
||||||
------------------------
|
--------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.decorators
|
.. automodule:: GPy.util.decorators
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`linalg` Module
|
GPy.util.linalg module
|
||||||
--------------------
|
----------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.linalg
|
.. automodule:: GPy.util.linalg
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`misc` Module
|
GPy.util.misc module
|
||||||
------------------
|
--------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.misc
|
.. automodule:: GPy.util.misc
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`mocap` Module
|
GPy.util.mocap module
|
||||||
-------------------
|
---------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.mocap
|
.. automodule:: GPy.util.mocap
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`pca` Module
|
GPy.util.multioutput module
|
||||||
-----------------
|
---------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.pca
|
.. automodule:: GPy.util.multioutput
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`plot` Module
|
GPy.util.plot module
|
||||||
------------------
|
--------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.plot
|
.. automodule:: GPy.util.plot
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`plot_latent` Module
|
GPy.util.plot_latent module
|
||||||
-------------------------
|
---------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.plot_latent
|
.. automodule:: GPy.util.plot_latent
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`squashers` Module
|
GPy.util.squashers module
|
||||||
-----------------------
|
-------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.squashers
|
.. automodule:: GPy.util.squashers
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`univariate_Gaussian` Module
|
GPy.util.univariate_Gaussian module
|
||||||
---------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.univariate_Gaussian
|
.. automodule:: GPy.util.univariate_Gaussian
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`visualize` Module
|
GPy.util.visualize module
|
||||||
-----------------------
|
-------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.visualize
|
.. automodule:: GPy.util.visualize
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`warping_functions` Module
|
GPy.util.warping_functions module
|
||||||
-------------------------------
|
---------------------------------
|
||||||
|
|
||||||
.. automodule:: GPy.util.warping_functions
|
.. automodule:: GPy.util.warping_functions
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Module contents
|
||||||
|
---------------
|
||||||
|
|
||||||
|
.. automodule:: GPy.util
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ print "finished importing"
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
class Mock(object):
|
class Mock(object):
|
||||||
|
__all__ = []
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
@ -105,8 +106,7 @@ class Mock(object):
|
||||||
print "Mocking"
|
print "Mocking"
|
||||||
MOCK_MODULES = ['sympy',
|
MOCK_MODULES = ['sympy',
|
||||||
'sympy.utilities', 'sympy.utilities.codegen', 'sympy.core.cache',
|
'sympy.utilities', 'sympy.utilities.codegen', 'sympy.core.cache',
|
||||||
'sympy.core', 'sympy.parsing', 'sympy.parsing.sympy_parser',
|
'sympy.core', 'sympy.parsing', 'sympy.parsing.sympy_parser'
|
||||||
'matplotlib.pyplot'
|
|
||||||
]
|
]
|
||||||
for mod_name in MOCK_MODULES:
|
for mod_name in MOCK_MODULES:
|
||||||
sys.modules[mod_name] = Mock()
|
sys.modules[mod_name] = Mock()
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -18,7 +18,7 @@ setup(name = 'GPy',
|
||||||
license = "BSD 3-clause",
|
license = "BSD 3-clause",
|
||||||
keywords = "machine-learning gaussian-processes kernels",
|
keywords = "machine-learning gaussian-processes kernels",
|
||||||
url = "http://sheffieldml.github.com/GPy/",
|
url = "http://sheffieldml.github.com/GPy/",
|
||||||
packages = ['GPy', 'GPy.core', 'GPy.kern', 'GPy.util', 'GPy.models', 'GPy.inference', 'GPy.examples', 'GPy.likelihoods', 'GPy.testing'],
|
packages = ['GPy', 'GPy.core', 'GPy.kern', 'GPy.util', 'GPy.models', 'GPy.inference', 'GPy.examples', 'GPy.likelihoods', 'GPy.testing', 'GPy.util.latent_space_visualizations', 'GPy.util.latent_space_visualizations.controllers', 'GPy.likelihoods.noise_models', 'GPy.kern.parts', 'GPy.mappings'],
|
||||||
package_dir={'GPy': 'GPy'},
|
package_dir={'GPy': 'GPy'},
|
||||||
package_data = {'GPy': ['GPy/examples']},
|
package_data = {'GPy': ['GPy/examples']},
|
||||||
py_modules = ['GPy.__init__'],
|
py_modules = ['GPy.__init__'],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue