示例#1
0
 def testIsPolynomial(self):
   # Linear kernel is subclass of Polynomial kernel
   self.assertIsInstance(tfpk.Linear(), tfpk.Polynomial)
示例#2
0
 def testValuesAreCorrect(self):
   k = tfpk.Linear()
   x = np.random.uniform(-1, 1, size=[5, 3]).astype(np.float32)
   y = np.random.uniform(-1, 1, size=[4, 3]).astype(np.float32)
   self.assertAllClose(x.dot(y.T), self.evaluate(k.matrix(x, y)))
示例#3
0
 def testIsPolynomial(self):
     # Linear kernel is subclass of Polynomial kernel
     self.assertIsInstance(psd_kernels.Linear(), psd_kernels.Polynomial)