Example #1
0
 def test_02(self):
     lmbda = 3
     try:
         b = tvl2.TVL2Deconv(cp.ones((1, 1)), self.D, lmbda)
         b.solve()
     except Exception as e:
         print(e)
         assert 0
Example #2
0
 def test_02(self):
     lmbda = 1e-1
     opt = tvl2.TVL2Deconv.Options(
         {'Verbose': False, 'gEvalY': False, 'MaxMainIter': 250})
     b = tvl2.TVL2Deconv(cp.ones((1)), self.D, lmbda, opt, axes=(0, 1, 2))
     X = b.solve()
     assert cp.abs(b.itstat[-1].ObjFun - 567.72425227) < 1e-3
     assert sm.mse(self.U, X) < 1e-3
Example #3
0
 def test_02(self):
     lmbda = 1e-1
     opt = tvl2.TVL2Deconv.Options(
         {'Verbose': False, 'gEvalY': False, 'MaxMainIter': 250})
     b = tvl2.TVL2Deconv(cp.ones((1)), self.D, lmbda, opt)
     X = b.solve()
     assert cp.abs(b.itstat[-1].ObjFun - 45.45958573088) < 1e-3
     assert sm.mse(self.U, X) < 1e-3
Example #4
0
 def test_07(self):
     lmbda = 3
     dt = cp.float64
     opt = tvl2.TVL2Deconv.Options(
         {'Verbose': False, 'MaxMainIter': 20, 'AutoRho':
          {'Enabled': True}, 'DataType': dt})
     b = tvl2.TVL2Deconv(cp.ones((1, )), self.D, lmbda, opt=opt)
     b.solve()
     assert b.X.dtype == dt
     assert b.Y.dtype == dt
     assert b.U.dtype == dt