summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/ccpi
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc3@googlemail.com>2018-05-12 21:39:07 +0100
committerGitHub <noreply@github.com>2018-05-12 21:39:07 +0100
commitf62562b93d0070211fc7fff3ad7d3c144b828a80 (patch)
treec09b8386a880f2f6dd158fecdbf62d540813119c /Wrappers/Python/ccpi
parent992146ad44767f9f34515393b608ec2ca0304cd1 (diff)
parent653e0adc87c255a392f30590af446fc78043e194 (diff)
downloadframework-plugins-f62562b93d0070211fc7fff3ad7d3c144b828a80.tar.gz
framework-plugins-f62562b93d0070211fc7fff3ad7d3c144b828a80.tar.bz2
framework-plugins-f62562b93d0070211fc7fff3ad7d3c144b828a80.tar.xz
framework-plugins-f62562b93d0070211fc7fff3ad7d3c144b828a80.zip
Merge pull request #11 from vais-ral/RGLTK_TV_denoising_demo
Rgltk tv denoising demo
Diffstat (limited to 'Wrappers/Python/ccpi')
-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),\