summaryrefslogtreecommitdiffstats
path: root/Wrappers
diff options
context:
space:
mode:
authorepapoutsellis <epapoutsellis@gmail.com>2019-04-10 11:33:31 +0100
committerepapoutsellis <epapoutsellis@gmail.com>2019-04-10 11:33:31 +0100
commit76f88d25572ce80057552fe05fc78ec621e98adf (patch)
treee1a06cc59e02973aa3d97d2d79dc33f150229d3a /Wrappers
parentebff46e78ce4ecc442c43fe44d4049d69bc8cc0a (diff)
downloadframework-76f88d25572ce80057552fe05fc78ec621e98adf.tar.gz
framework-76f88d25572ce80057552fe05fc78ec621e98adf.tar.bz2
framework-76f88d25572ce80057552fe05fc78ec621e98adf.tar.xz
framework-76f88d25572ce80057552fe05fc78ec621e98adf.zip
wip for with and without operators, functions
Diffstat (limited to 'Wrappers')
-rw-r--r--Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py b/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py
index 3b81d98..0d479ee 100644
--- a/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py
+++ b/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py
@@ -141,21 +141,25 @@ def PDHG_old(f, g, operator, tau = None, sigma = None, opt = None, **kwargs):
else:
-# operator.direct(xbar, out = y_tmp)
+ operator.direct(xbar, out = y_tmp)
+
+ y_tmp.multiply(sigma, out = y_tmp)
+ y_tmp.add(y_old, out = y_tmp)
# y_tmp.__imul__(sigma)
# y_tmp.__iadd__(y_old)
# y_tmp *= sigma
# y_tmp += y_old
- y_tmp = y_old + sigma * operator.direct(xbar)
+# y_tmp = y_old + sigma * operator.direct(xbar)
f.proximal_conjugate(y_tmp, sigma, out=y)
- x_tmp = x_old - tau * operator.adjoint(y)
+# x_tmp = x_old - tau * operator.adjoint(y)
+
+ operator.adjoint(y, out = x_tmp)
+ x_tmp.multiply(-tau, out = x_tmp)
+ x_tmp.add(x_old, out = x_tmp)
-# operator.adjoint(y, out = x_tmp)
-# z = x_tmp
-# x_tmp = x_old - tau * z
# x_tmp *= -tau
# x_tmp += x_old
@@ -166,7 +170,8 @@ def PDHG_old(f, g, operator, tau = None, sigma = None, opt = None, **kwargs):
xbar *= theta
xbar += x
-
+ x_old.fill(x)
+ y_old.fill(y)
# pass
#