diff options
Diffstat (limited to 'Wrappers/Python/ccpi')
-rw-r--r-- | Wrappers/Python/ccpi/plugins/regularisers.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Wrappers/Python/ccpi/plugins/regularisers.py b/Wrappers/Python/ccpi/plugins/regularisers.py index 9f4d3fc..46464a9 100644 --- a/Wrappers/Python/ccpi/plugins/regularisers.py +++ b/Wrappers/Python/ccpi/plugins/regularisers.py @@ -34,9 +34,8 @@ class _ROF_TV_(Operator): self.device = device # string for 'cpu' or 'gpu' def __call__(self,x): # evaluate objective function of TV gradient - # typeEnergy is either 1 (LS + TV for denoising) or 2 (just TV fidelity) EnergyValTV = TV_ENERGY(np.asarray(x.as_array(), dtype=np.float32), np.asarray(x.as_array(), dtype=np.float32), self.lambdaReg, 2) - return EnergyValTV + return 0.5*EnergyValTV[0] def prox(self,x,Lipshitz): pars = {'algorithm' : ROF_TV, \ 'input' : np.asarray(x.as_array(), dtype=np.float32),\ @@ -62,9 +61,8 @@ class _FGP_TV_(Operator): self.device = device # string for 'cpu' or 'gpu' def __call__(self,x): # evaluate objective function of TV gradient - # typeEnergy is either 1 (LS + TV for denoising) or 2 (just TV fidelity) EnergyValTV = TV_ENERGY(np.asarray(x.as_array(), dtype=np.float32), np.asarray(x.as_array(), dtype=np.float32), self.lambdaReg, 2) - return EnergyValTV + return 0.5*EnergyValTV[0] def prox(self,x,Lipshitz): pars = {'algorithm' : FGP_TV, \ 'input' : np.asarray(x.as_array(), dtype=np.float32),\ @@ -96,9 +94,8 @@ class _SB_TV_(Operator): self.device = device # string for 'cpu' or 'gpu' def __call__(self,x): # evaluate objective function of TV gradient - # typeEnergy is either 1 (LS + TV for denoising) or 2 (just TV fidelity) EnergyValTV = TV_ENERGY(np.asarray(x.as_array(), dtype=np.float32), np.asarray(x.as_array(), dtype=np.float32), self.lambdaReg, 2) - return EnergyValTV + return 0.5*EnergyValTV[0] def prox(self,x,Lipshitz): pars = {'algorithm' : SB_TV, \ 'input' : np.asarray(x.as_array(), dtype=np.float32),\ |