diff options
author | epapoutsellis <epapoutsellis@gmail.com> | 2019-06-03 22:50:50 +0100 |
---|---|---|
committer | epapoutsellis <epapoutsellis@gmail.com> | 2019-06-03 22:50:50 +0100 |
commit | 1aa94932776f3a95b02304b1dfd8a18459d7e37c (patch) | |
tree | dacb5c1aec2d8b0fb7ab61ea5b1647b996f7f36f /Wrappers/Python | |
parent | c9f7f66da692d5ec8d5927775dbff3ac3aeb8c7c (diff) | |
download | framework-1aa94932776f3a95b02304b1dfd8a18459d7e37c.tar.gz framework-1aa94932776f3a95b02304b1dfd8a18459d7e37c.tar.bz2 framework-1aa94932776f3a95b02304b1dfd8a18459d7e37c.tar.xz framework-1aa94932776f3a95b02304b1dfd8a18459d7e37c.zip |
fix dot
Diffstat (limited to 'Wrappers/Python')
-rw-r--r-- | Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py b/Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py index b77d472..2f05119 100644 --- a/Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py +++ b/Wrappers/Python/ccpi/optimisation/functions/L2NormSquared.py @@ -76,7 +76,7 @@ class L2NormSquared(Function): tmp = 0 if self.b is not None: - tmp = (x * self.b).sum() + tmp = x.dot(self.b) #(x * self.b).sum() return (1./4.) * x.squared_norm() + tmp @@ -151,7 +151,7 @@ if __name__ == '__main__': import numpy # TESTS for L2 and scalar * L2 - M, N, K = 2,3,5 + M, N, K = 20,30,50 ig = ImageGeometry(voxel_num_x=M, voxel_num_y = N, voxel_num_z = K) u = ig.allocate('random_int') b = ig.allocate('random_int') @@ -178,7 +178,7 @@ if __name__ == '__main__': #check convex conjuagate with data d1 = f1.convex_conjugate(u) - d2 = (1/4) * u.squared_norm() + (u*b).sum() + d2 = (1/4) * u.squared_norm() + u.dot(b) numpy.testing.assert_equal(d1, d2) # check proximal no data |