Example #1
0
 def test_04(self):
     Nr = 16
     Nc = 17
     C = 3
     Nd = 5
     Md = 4
     Mb = 4
     D = cp.random.randn(Nd, Nd, Md)
     B = cp.random.randn(C, Mb)
     s = cp.random.randn(Nr, Nc, C)
     lmbda = 1e-1
     mu = 1e-2
     try:
         opt = pdcsc.ConvProdDictL1L1GrdJoint.Options(
             {'LinSolveCheck': True})
         b = pdcsc.ConvProdDictL1L1GrdJoint(D,
                                            B,
                                            s,
                                            lmbda,
                                            mu,
                                            opt=opt,
                                            dimK=0)
         b.solve()
     except Exception as e:
         print(e)
         assert 0
     assert list2array(b.getitstat().XSlvRelRes).max() < 1e-4
Example #2
0
 def test_12(self):
     N = 16
     Nd = 5
     Cs = 3
     M = 4
     D = cp.random.randn(Nd, Nd, M)
     s = cp.random.randn(N, N, Cs)
     lmbda = 1e-1
     L = 1e3
     opt = cbpdn.ConvBPDN.Options({'L': L})
     b = cbpdn.ConvBPDN(D, s, lmbda, opt=opt, dimK=0)
     b.solve()
     assert list2array(b.getitstat().Rsdl)[-1] < 1e-3
Example #3
0
 def test_14(self):
     N = 16
     Nd = 5
     Cs = 3
     M = 4
     D = cp.random.randn(Nd, Nd, M)
     s = cp.random.randn(N, N, Cs)
     lmbda = 1e-1
     try:
         opt = cbpdn.ConvBPDNJoint.Options({'LinSolveCheck': True})
         b = cbpdn.ConvBPDNJoint(D, s, lmbda, opt=opt, dimK=0)
         b.solve()
     except Exception as e:
         print(e)
         assert 0
     assert list2array(b.getitstat().XSlvRelRes).max() < 1e-5
Example #4
0
 def test_08(self):
     Nr = 16
     Nc = 17
     Nd = 5
     M = 4
     D = cp.random.randn(Nd, Nd, M)
     s = cp.random.randn(Nr, Nc)
     lmbda = 1e-1
     try:
         opt = cbpdn.ConvBPDN.Options({'LinSolveCheck': True})
         b = cbpdn.ConvBPDN(D, s, lmbda, opt=opt)
         b.solve()
     except Exception as e:
         print(e)
         assert 0
     assert list2array(b.getitstat().XSlvRelRes).max() < 1e-5
Example #5
0
 def test_03(self):
     N = 16
     Nd = 5
     M = 4
     D = cp.random.randn(Nd, Nd, M)
     s = cp.random.randn(N, N)
     lmbda = 1e-1
     mu = 1e-2
     try:
         opt = cbpdntv.ConvBPDNRecTV.Options({'LinSolveCheck': True})
         b = cbpdntv.ConvBPDNRecTV(D, s, lmbda, mu, opt=opt)
         b.solve()
     except Exception as e:
         print(e)
         assert 0
     assert list2array(b.getitstat().XSlvRelRes).max() < 1e-5
Example #6
0
 def test_18(self):
     N = 16
     Nd = 5
     Cs = 3
     M = 4
     D = cp.random.randn(Nd, Nd, M)
     s = cp.random.randn(N, N, Cs)
     lmbda = 1e-1
     L = 1e3
     try:
         opt = cbpdn.ConvBPDN.Options({'Monotone': True, 'L': L})
         b = cbpdn.ConvBPDN(D, s, lmbda, opt=opt, dimK=0)
         b.solve()
     except Exception as e:
         print(e)
         assert 0
     assert list2array(b.getitstat().Rsdl)[-1] < 1e-3
Example #7
0
 def test_03(self):
     N = 8
     M = 16
     D = cp.random.randn(N, M)
     s = cp.random.randn(N, 1)
     try:
         opt = bpdn.BPDN.Options({
             'Verbose': False,
             'MaxMainIter': 20,
             'LinSolveCheck': True,
             'AutoRho': {
                 'StdResiduals': True
             }
         })
         b = bpdn.BPDN(D, s, lmbda=1.0, opt=opt)
         b.solve()
     except Exception as e:
         print(e)
         assert 0
     assert list2array(b.getitstat().XSlvRelRes).max() < 1e-5