diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-05-09 12:33:12 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-05-09 12:33:12 +0100 |
commit | b377d100af892052c86c21ebac3b3ab29918b080 (patch) | |
tree | 9e9ec7370a23b09875ecca69f9254c2bfbf78535 | |
parent | bd846706efa1aa1a0cea0b087cadce807928a3d5 (diff) | |
download | framework-b377d100af892052c86c21ebac3b3ab29918b080.tar.gz framework-b377d100af892052c86c21ebac3b3ab29918b080.tar.bz2 framework-b377d100af892052c86c21ebac3b3ab29918b080.tar.xz framework-b377d100af892052c86c21ebac3b3ab29918b080.zip |
save files as data_files
-rw-r--r-- | Wrappers/Python/ccpi/optimisation/functions/KullbackLeibler.py | 27 | ||||
-rw-r--r-- | 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 |