Пример #1
0
 def test_1(self):
     l2svm.run()
     raiseException()
     expected = np.repeat(2/3, self.n)
     diff = np.linalg.norm(self.weight - expected)
     self.assertLessEqual(diff, 1e-12, '|w* - w|')
     self.assertAlmostEqual(l2svm.gradnorm(), 0, delta=1e-12, msg='|grad|')
Пример #2
0
 def gradnorm(self):
     try: return l2svm.gradnorm()
     finally: check_error()
Пример #3
0
 def assertNorm(self):
     gnorm = l2svm.gradnorm()
     raiseException()
     self.assertAlmostEqual(self.expected(), gnorm, delta=1e-12)