summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/ccpi/plugins/regularisers.py
diff options
context:
space:
mode:
Diffstat (limited to 'Wrappers/Python/ccpi/plugins/regularisers.py')
-rw-r--r--Wrappers/Python/ccpi/plugins/regularisers.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Wrappers/Python/ccpi/plugins/regularisers.py b/Wrappers/Python/ccpi/plugins/regularisers.py
index e9c88a4..46464a9 100644
--- a/Wrappers/Python/ccpi/plugins/regularisers.py
+++ b/Wrappers/Python/ccpi/plugins/regularisers.py
@@ -25,7 +25,6 @@ from ccpi.optimisation.ops import Operator
import numpy as np
-
class _ROF_TV_(Operator):
def __init__(self,lambdaReg,iterationsTV,tolerance,time_marchstep,device):
# set parameters
@@ -36,7 +35,7 @@ class _ROF_TV_(Operator):
def __call__(self,x):
# evaluate objective function of TV gradient
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),\
@@ -63,7 +62,7 @@ class _FGP_TV_(Operator):
def __call__(self,x):
# evaluate objective function of TV gradient
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,7 +95,7 @@ class _SB_TV_(Operator):
def __call__(self,x):
# evaluate objective function of TV gradient
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),\