From fd3cc5601e9aad0b516ea73a34eef839861ab8f8 Mon Sep 17 00:00:00 2001 From: epapoutsellis Date: Fri, 10 May 2019 12:25:03 +0100 Subject: still not correct --- .../Python/ccpi/optimisation/functions/KullbackLeibler.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py b/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py index e298d92..d808e63 100644 --- a/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py +++ b/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py @@ -25,7 +25,7 @@ import functools class KullbackLeibler(Function): - ''' Assume that data > 0 + ''' Assume that data >= 0 ''' @@ -125,7 +125,18 @@ class KullbackLeibler(Function): ''' - return ScaledFunction(self, scalar) + return ScaledFunction(self, scalar) + + +if __name__ == '__main__': + + from ccpi.framework import ImageGeometry + import numpy + + M, N = 2,3 + ig = ImageGeometry(voxel_num_x=M, voxel_num_y = N) + u = ig.allocate('random_int') + b = np.random.normal(0, 0.1, size=ig.shape) -- cgit v1.2.3