summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python
diff options
context:
space:
mode:
authorepapoutsellis <epapoutsellis@gmail.com>2019-06-12 15:22:37 +0100
committerepapoutsellis <epapoutsellis@gmail.com>2019-06-12 15:22:37 +0100
commitc429efbf2bc85d42c010961cdf5e8a4c8d8c50b3 (patch)
tree0f5492b1a097c9a96a301946922f91f1618e28d3 /Wrappers/Python
parentc2ec8d85841b059437d9e97a46540ee4e712b593 (diff)
downloadframework-c429efbf2bc85d42c010961cdf5e8a4c8d8c50b3.tar.gz
framework-c429efbf2bc85d42c010961cdf5e8a4c8d8c50b3.tar.bz2
framework-c429efbf2bc85d42c010961cdf5e8a4c8d8c50b3.tar.xz
framework-c429efbf2bc85d42c010961cdf5e8a4c8d8c50b3.zip
fix demos
Diffstat (limited to 'Wrappers/Python')
-rwxr-xr-xWrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising.py6
-rw-r--r--Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Tomo2D.py10
2 files changed, 8 insertions, 8 deletions
diff --git a/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising.py b/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising.py
index d848b9f..6937fa0 100755
--- a/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising.py
+++ b/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Denoising.py
@@ -63,6 +63,7 @@ from ccpi.optimisation.functions import ZeroFunction, L1Norm, \
KullbackLeibler
from ccpi.framework import TestData
import os, sys
+#import scipy.io
if int(numpy.version.version.split('.')[1]) > 12:
from skimage.util import random_noise
else:
@@ -211,7 +212,7 @@ else:
plt.show()
-##%% Check with CVX solution
+#%% Check with CVX solution
from ccpi.optimisation.operators import SparseFiniteDiff
@@ -231,8 +232,7 @@ if cvx_not_installable:
DX = SparseFiniteDiff(ig, direction=1, bnd_cond='Neumann')
# Define Total Variation as a regulariser
- regulariser = alpha * sum(norm(vstack([DX.matrix() * vec(u), DY.matrix() * vec(u)]), 2, axis = 0))
- fidelity = pnorm( u - noisy_data.as_array(),1)
+ regulariser = alpha * sum(norm(vstack([Constant(DX.matrix()) * vec(u), Constant(DY.matrix()) * vec(u)]), 2, axis = 0))
# choose solver
if 'MOSEK' in installed_solvers():
diff --git a/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Tomo2D.py b/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Tomo2D.py
index f179e95..4f7639e 100644
--- a/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Tomo2D.py
+++ b/Wrappers/Python/demos/PDHG_examples/GatherAll/PDHG_TV_Tomo2D.py
@@ -52,12 +52,12 @@ from ccpi.astra.ops import AstraProjectorSimple
from ccpi.framework import TestData
from PIL import Image
import os, sys
-if int(numpy.version.version.split('.')[1]) > 12:
- from skimage.util import random_noise
-else:
- from demoutil import random_noise
+#if int(numpy.version.version.split('.')[1]) > 12:
+from skimage.util import random_noise
+#else:
+# from demoutil import random_noise
-import scipy.io
+#import scipy.io
# user supplied input
if len(sys.argv) > 1: