diff options
author | Daniil Kazantsev <dkazanc@hotmail.com> | 2018-05-12 19:03:26 +0100 |
---|---|---|
committer | Daniil Kazantsev <dkazanc@hotmail.com> | 2018-05-12 19:03:26 +0100 |
commit | d1875172687fc854df35fa9bfc6ac07a148d7f18 (patch) | |
tree | a93ede4c3e74262be654ffbecbd160f31409a04a /Wrappers/Python/ccpi | |
parent | 3d939a6139e664c3f8143031d0aaf765298efda5 (diff) | |
download | framework-plugins-d1875172687fc854df35fa9bfc6ac07a148d7f18.tar.gz framework-plugins-d1875172687fc854df35fa9bfc6ac07a148d7f18.tar.bz2 framework-plugins-d1875172687fc854df35fa9bfc6ac07a148d7f18.tar.xz framework-plugins-d1875172687fc854df35fa9bfc6ac07a148d7f18.zip |
fixed objective2
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),\ |