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_legacy.CCovSqexpARD(n_dim1)
     Cr.setX(Xr)
     Cc = dlimix_legacy.CCovLinearARD(n_dim2)
     Cc.setX(Xc)
     self.C = dlimix_legacy.CKroneckerCF()
     self.C.setRowCovariance(Cr)
     self.C.setColCovariance(Cc)
     #set kronecker index
     self.kronecker_index = dlimix_legacy.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_legacy.CCovSqexpARD(self.n_dim)
     self.name = 'CCovSqexpARD'
     self.C.setX(X)
     K = self.C.K()
     self.n_params = self.C.getNumberParams()
     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_legacy.CProductCF()
     self.C.addCovariance(dlimix_legacy.CCovSqexpARD(n_dim1))
     self.C.addCovariance(dlimix_legacy.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)
     n1 = 3
     n2 = 5
     n_dim1 = 8
     n_dim2 = 12
     X1 = SP.rand(n1, n_dim1)
     X2 = SP.rand(n2, n_dim2)
     C1 = dlimix_legacy.CCovSqexpARD(n_dim1)
     C1.setX(X1)
     C2 = dlimix_legacy.CCovLinearARD(n_dim2)
     C2.setX(X2)
     self.C = dlimix_legacy.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)