diff options
author | epapoutsellis <epapoutsellis@gmail.com> | 2019-04-20 18:45:39 +0100 |
---|---|---|
committer | epapoutsellis <epapoutsellis@gmail.com> | 2019-04-20 18:45:39 +0100 |
commit | b200f96782c3756110bfbfc3c6cf5093c7d2a12b (patch) | |
tree | d31b399bf596346635413c16c1bfbc658027d14f /Wrappers | |
parent | df538e0d55513274ba27285764783359ef7b5c6c (diff) | |
download | framework-b200f96782c3756110bfbfc3c6cf5093c7d2a12b.tar.gz framework-b200f96782c3756110bfbfc3c6cf5093c7d2a12b.tar.bz2 framework-b200f96782c3756110bfbfc3c6cf5093c7d2a12b.tar.xz framework-b200f96782c3756110bfbfc3c6cf5093c7d2a12b.zip |
fix KL & L2
Diffstat (limited to 'Wrappers')
-rw-r--r-- | Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py | 2 | ||||
-rw-r--r-- | Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py b/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py index 1a64b13..22d21fd 100644 --- a/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py +++ b/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py @@ -93,6 +93,7 @@ class KullbackLeibler(Function): if out is None: return 0.5 *( (x - self.bnoise - tau) + ( (x + self.bnoise - tau)**2 + 4*tau*self.b ) .sqrt() ) else: + tmp = 0.5 *( (x - self.bnoise - tau) + ( (x + self.bnoise - tau)**2 + 4*tau*self.b ) .sqrt() ) @@ -152,6 +153,7 @@ if __name__ == '__main__': from ccpi.framework import ImageGeometry import numpy + N, M = 2,3 ig = ImageGeometry(N, M) data = ImageData(numpy.random.randint(-10, 10, size=(M, N))) diff --git a/Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py b/Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py index ca6e7a7..5490782 100644 --- a/Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py +++ b/Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py @@ -71,7 +71,7 @@ class L2NormSquared(Function): def convex_conjugate(self, x): ''' Evaluate convex conjugate of L2NormSquared at x: f^{*}(x)''' - + tmp = 0 if self.b is not None: |