def test_001_CPLS(self): """Test Chambolle-Pock least-squares algorithm in 2D.""" (A, At) = self.get_A_At('2d') algo = solvers.CP() (sol, residual) = algo(A, self.data_rand_2d, 2000, At=At) print('Max absolute deviation is: {}. '.format( np.max(np.abs(self.vol_rand_2d - sol))), end='', flush=True) assert np.all(np.isclose(sol, self.vol_rand_2d, atol=1e-3))
def test_004_CPLSTV_unconstrained(self): """Test Chambolle-Pock unconstrained least-squares TV-min algorithm in 2D.""" (A, At) = self.get_A_At('2d') reg = solvers.Regularizer_TV2D(1e-4) algo = solvers.CP(regularizer=reg) (sol, residual) = algo(A, self.data_flat_2d, 2500, At=At) print('Max absolute deviation is: {}. '.format( np.max(np.abs(self.vol_flat_2d - sol))), end='', flush=True) assert np.all(np.isclose(sol, self.vol_flat_2d, atol=1e-3))