diff options
-rw-r--r-- | Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py | 15 |
1 files 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) |