mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
fix for tie print
This commit is contained in:
parent
c279da4c75
commit
f0df591625
3 changed files with 6 additions and 6 deletions
|
|
@ -224,7 +224,7 @@ class Param(Parameterizable, ObsAr):
|
||||||
def _ties_str(self):
|
def _ties_str(self):
|
||||||
return ['']
|
return ['']
|
||||||
def _ties_for(self, ravi):
|
def _ties_for(self, ravi):
|
||||||
return [['N/A' if self.tie.flat[i]==0 else str(self.tie[i])] for i in xrange(ravi.size)]
|
return [['N/A' if self.tie.flat[i]==0 else str(self.tie.flat[i])] for i in xrange(ravi.size)]
|
||||||
def __repr__(self, *args, **kwargs):
|
def __repr__(self, *args, **kwargs):
|
||||||
name = "\033[1m{x:s}\033[0;0m:\n".format(
|
name = "\033[1m{x:s}\033[0;0m:\n".format(
|
||||||
x=self.hierarchy_name())
|
x=self.hierarchy_name())
|
||||||
|
|
|
||||||
|
|
@ -315,9 +315,9 @@ def bgplvm_simulation(optimize=True, verbose=1,
|
||||||
m.kern.plot_ARD('BGPLVM Simulation ARD Parameters')
|
m.kern.plot_ARD('BGPLVM Simulation ARD Parameters')
|
||||||
return m
|
return m
|
||||||
|
|
||||||
def ssgplvm_simulation(optimize=True, verbose=1,
|
def ssgplvm_simulation(optimize=True, verbose=1, group_spike=True,
|
||||||
plot=True, plot_sim=False,
|
plot=True, plot_sim=False,
|
||||||
max_iters=2e4, useGPU=False
|
max_iters=2e4
|
||||||
):
|
):
|
||||||
from GPy import kern
|
from GPy import kern
|
||||||
from GPy.models import SSGPLVM
|
from GPy.models import SSGPLVM
|
||||||
|
|
@ -325,9 +325,9 @@ def ssgplvm_simulation(optimize=True, verbose=1,
|
||||||
D1, D2, D3, N, num_inducing, Q = 13, 5, 8, 45, 3, 9
|
D1, D2, D3, N, num_inducing, Q = 13, 5, 8, 45, 3, 9
|
||||||
_, _, Ylist = _simulate_sincos(D1, D2, D3, N, num_inducing, Q, plot_sim)
|
_, _, Ylist = _simulate_sincos(D1, D2, D3, N, num_inducing, Q, plot_sim)
|
||||||
Y = Ylist[0]
|
Y = Ylist[0]
|
||||||
k = kern.Linear(Q, ARD=True, useGPU=useGPU)# + kern.white(Q, _np.exp(-2)) # + kern.bias(Q)
|
k = kern.Linear(Q, ARD=True)# + kern.white(Q, _np.exp(-2)) # + kern.bias(Q)
|
||||||
#k = kern.RBF(Q, ARD=True, lengthscale=10.)
|
#k = kern.RBF(Q, ARD=True, lengthscale=10.)
|
||||||
m = SSGPLVM(Y, Q, init="pca", num_inducing=num_inducing, kernel=k)
|
m = SSGPLVM(Y, Q, init="init", num_inducing=num_inducing, kernel=k, group_spike=group_spike)
|
||||||
m.X.variance[:] = _np.random.uniform(0,.01,m.X.shape)
|
m.X.variance[:] = _np.random.uniform(0,.01,m.X.shape)
|
||||||
m.likelihood.variance = .1
|
m.likelihood.variance = .1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class SSGPLVM(SparseGP_MPI):
|
||||||
# self.X.variance.constrain_positive()
|
# self.X.variance.constrain_positive()
|
||||||
|
|
||||||
if self.group_spike:
|
if self.group_spike:
|
||||||
[self.X.gamma[:,i].tie('tieGamma'+str(i)) for i in xrange(self.X.gamma.shape[1])] # Tie columns together
|
[self.X.gamma[:,i].tie_together() for i in xrange(self.X.gamma.shape[1])] # Tie columns together
|
||||||
|
|
||||||
def set_X_gradients(self, X, X_grad):
|
def set_X_gradients(self, X, X_grad):
|
||||||
"""Set the gradients of the posterior distribution of X in its specific form."""
|
"""Set the gradients of the posterior distribution of X in its specific form."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue