summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python
diff options
context:
space:
mode:
authorepapoutsellis <epapoutsellis@gmail.com>2019-04-12 16:01:12 +0100
committerepapoutsellis <epapoutsellis@gmail.com>2019-04-12 16:01:12 +0100
commit76906f3a5941b45441ee0209605d73ea6fb445f2 (patch)
treebb8f855002258723f3ffce0061a724c83a56b71c /Wrappers/Python
parent4c88537805e864b1d6fdf2d40a9d147bf72bcbe3 (diff)
downloadframework-76906f3a5941b45441ee0209605d73ea6fb445f2.tar.gz
framework-76906f3a5941b45441ee0209605d73ea6fb445f2.tar.bz2
framework-76906f3a5941b45441ee0209605d73ea6fb445f2.tar.xz
framework-76906f3a5941b45441ee0209605d73ea6fb445f2.zip
fix memopt and docstrings
Diffstat (limited to 'Wrappers/Python')
-rwxr-xr-xWrappers/Python/wip/pdhg_TV_denoising.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/Wrappers/Python/wip/pdhg_TV_denoising.py b/Wrappers/Python/wip/pdhg_TV_denoising.py
index f276b46..eedeeb8 100755
--- a/Wrappers/Python/wip/pdhg_TV_denoising.py
+++ b/Wrappers/Python/wip/pdhg_TV_denoising.py
@@ -25,8 +25,6 @@ def dt(steps):
#%%
-
-# ############################################################################
# Create phantom for TV denoising
N = 200
@@ -90,8 +88,8 @@ print ("normK", normK)
sigma = 1
tau = 1/(sigma*normK**2)
-opt = {'niter':1000}
-opt1 = {'niter':1000, 'memopt': True}
+opt = {'niter':2000}
+opt1 = {'niter':2000, 'memopt': True}
t1 = timer()
res, time, primal, dual, pdgap = PDHG_old(f, g, operator, tau = tau, sigma = sigma, opt = opt)
@@ -114,10 +112,15 @@ plt.colorbar()
plt.show()
+diff = np.abs(res1.as_array()-res.as_array())
plt.figure(figsize=(5,5))
-plt.imshow(np.abs(res1.as_array()-res.as_array()))
+plt.imshow(diff)
plt.colorbar()
plt.show()
+
+diff = (res-res1)
+print ("diff norm {} max {}".format(diff.norm(), diff.abs().as_array().max()))
+print ("Sum ( abs(diff) ) {}".format(diff.abs().sum()))
#=======
## opt = {'niter':2000, 'memopt': True}
#