Ejemplo n.º 1
0
 def setUp(self):
     SP.random.seed(1)
     nr = 3
     nc = 5
     n_dim1 = 8
     n_dim2 = 12
     #truncation of soft kronecker
     self.n_trunk = 10
     Xr = SP.rand(nr, n_dim1)
     Xc = SP.rand(nc, n_dim2)
     Cr = dlimix.CCovSqexpARD(n_dim1)
     Cr.setX(Xr)
     Cc = dlimix.CCovLinearARD(n_dim2)
     Cc.setX(Xc)
     self.C = dlimix.CKroneckerCF()
     self.C.setRowCovariance(Cr)
     self.C.setColCovariance(Cc)
     #set kronecker index
     self.kronecker_index = dlimix.CKroneckerCF.createKroneckerIndex(nc, nr)
     self.n = self.C.Kdim()
     self.n_dim = self.C.getNumberDimensions()
     self.name = 'CKroneckerCF'
     self.n_params = self.C.getNumberParams()
     params = SP.exp(SP.randn(self.n_params))
     self.C.setParams(params)
Ejemplo n.º 2
0
 def setUp(self):
     SP.random.seed(1)
     self.n = 10
     self.n_dim = 10
     X = SP.rand(self.n, self.n_dim)
     self.C = dlimix.CCovLinearARD(self.n_dim)
     self.name = 'CCovLinearARD'
     self.C.setX(X)
     self.n_params = self.C.getNumberParams()
     K = self.C.K()
     params = SP.exp(SP.randn(self.n_params))
     self.C.setParams(params)
Ejemplo n.º 3
0
 def setUp(self):
     SP.random.seed(1)
     self.n=10
     n_dim1=8
     n_dim2=12
     self.C=dlimix.CProductCF()
     self.C.addCovariance(dlimix.CCovSqexpARD(n_dim1));
     self.C.addCovariance(dlimix.CCovLinearARD(n_dim2));
     self.n_dim=self.C.getNumberDimensions()
     X=SP.rand(self.n,self.n_dim)
     self.C.setX(X)
     self.name = 'CProductCF'
     self.n_params=self.C.getNumberParams()
     params=SP.exp(SP.randn(self.n_params))
     self.C.setParams(params)
Ejemplo n.º 4
0
 def setUp(self):
     SP.random.seed(1)
     self.n=10
     n_dim2=12
     K0 = SP.eye(self.n)
     self.C=dlimix.CSumCF()
     #sum of fixed CF and linearARD
     covar1 = dlimix.CFixedCF(K0)
     covar2 = dlimix.CCovLinearARD(n_dim2)
     self.C.addCovariance(covar1)
     self.C.addCovariance(covar2)
     self.n_dim=self.C.getNumberDimensions()
     self.X=SP.rand(self.n,self.n_dim)
     self.C.setX(self.X)
     self.name = 'CSumCF'
     self.n_params=self.C.getNumberParams()
     params=SP.exp(SP.randn(self.n_params))
     self.C.setParams(params)
Ejemplo n.º 5
0
 def setUp(self):
     SP.random.seed(1)
     n1=3
     n2=5
     n_dim1=8
     n_dim2=12
     X1 = SP.rand(n1,n_dim1)
     X2 = SP.rand(n2,n_dim2)
     C1 = dlimix.CCovSqexpARD(n_dim1); C1.setX(X1)
     C2 = dlimix.CCovLinearARD(n_dim2);  C2.setX(X2)
     self.C = dlimix.CKroneckerCF()
     self.C.setRowCovariance(C1)
     self.C.setColCovariance(C2)
     self.n = self.C.Kdim()
     self.n_dim=self.C.getNumberDimensions()
     self.name = 'CKroneckerCF'
     self.n_params=self.C.getNumberParams()
     params=SP.exp(SP.randn(self.n_params))
     self.C.setParams(params)