From b377d100af892052c86c21ebac3b3ab29918b080 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Thu, 9 May 2019 12:33:12 +0100 Subject: save files as data_files --- .../ccpi/optimisation/functions/KullbackLeibler.py | 27 +++++++++++++--------- Wrappers/Python/setup.py | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py b/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py index 3096191..ceea5ce 100644 --- a/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py +++ b/Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py @@ -107,26 +107,31 @@ class KullbackLeibler(Function): return 0.5*((z + 1) - ((z-1)**2 + 4 * tau * self.b).sqrt()) else: - tmp = x + tau * self.bnoise - self.b.multiply(4*tau, out=out) - out.add((tmp-1)**2, out=out) + #tmp = x + tau * self.bnoise + tmp = tau * self.bnoise + tmp += x + tmp -= 1 + + self.b.multiply(4*tau, out=out) + + out.add((tmp)**2, out=out) out.sqrt(out=out) out *= -1 - out.add(tmp+1, out=out) + tmp += 2 + out += tmp out *= 0.5 - - -# z_m = x + tau * self.bnoise -1 +# z_m = x + tau * self.bnoise - 1 # self.b.multiply(4*tau, out=out) # z_m.multiply(z_m, out=z_m) # out += z_m -# # out.sqrt(out=out) -# +# # z = z_m + 2 +# z_m.sqrt(out=z_m) +# z_m += 2 # out *= -1 -# out += tmp2 -# out *= 0.5 +# out += z_m + diff --git a/Wrappers/Python/setup.py b/Wrappers/Python/setup.py index 6c76eff..44da471 100644 --- a/Wrappers/Python/setup.py +++ b/Wrappers/Python/setup.py @@ -39,7 +39,7 @@ setup( 'ccpi.processors', 'ccpi.contrib','ccpi.contrib.optimisation', 'ccpi.contrib.optimisation.algorithms'], - data_file = [('share/ccpi', ['data/boat.tiff', 'data/peppers.tiff', + data_files = [('share/ccpi', ['data/boat.tiff', 'data/peppers.tiff', 'data/camera.png'])], # Project uses reStructuredText, so ensure that the docutils get -- cgit v1.2.3