diff options
author | algol <dkazanc@hotmail.com> | 2018-02-08 17:12:27 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2018-02-09 16:24:47 +0000 |
commit | 821c37c37c60dd76a102867d7a8e8c0d6e06af70 (patch) | |
tree | 62209ac8aeaaa0d8227c60115cde8258529ad0d7 /Wrappers | |
parent | e3074f221e063c91a08e9a05ed419b6b8557d5ca (diff) | |
download | regularization-821c37c37c60dd76a102867d7a8e8c0d6e06af70.tar.gz regularization-821c37c37c60dd76a102867d7a8e8c0d6e06af70.tar.bz2 regularization-821c37c37c60dd76a102867d7a8e8c0d6e06af70.tar.xz regularization-821c37c37c60dd76a102867d7a8e8c0d6e06af70.zip |
some corrections in GPU-reg demos
Diffstat (limited to 'Wrappers')
-rw-r--r-- | Wrappers/Python/test/test_gpu_regularizers.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Wrappers/Python/test/test_gpu_regularizers.py b/Wrappers/Python/test/test_gpu_regularizers.py index 1a78132..18fbdd3 100644 --- a/Wrappers/Python/test/test_gpu_regularizers.py +++ b/Wrappers/Python/test/test_gpu_regularizers.py @@ -27,6 +27,10 @@ def printParametersToString(pars): txt += '\n' return txt ############################################################################### +def rmse(im1, im2): + a, b = im1.shape + rmse = np.sqrt(np.sum((im1 - im2) ** 2) / float(a * b)) + return rmse filename = os.path.join(".." , ".." , ".." , "data" ,"lena_gray_512.tif") #filename = r"C:\Users\ofn77899\Documents\GitHub\CCPi-FISTA_reconstruction\data\lena_gray_512.tif" @@ -99,11 +103,20 @@ pars = {'algorithm' : NML , \ 'h':0.05 ,# 'lambda' : 0.08 } +pars = { + 'input' : u0, + 'regularization_parameter': 0.05,\ + 'searching_window_ratio':3, \ + 'similarity_window_ratio':1,\ + 'PB_filtering_parameter': 0.06 +} nml = NML(pars['input'], - pars['SearchW_real'], - pars['SimilW'], - pars['h'], - pars['lambda']) + pars['searching_window_ratio'], + pars['similarity_window_ratio'], + pars['PB_filtering_parameter'], + pars['regularization_parameter']) +rms = rmse(Im, nml) +pars['rmse'] = rms txtstr = printParametersToString(pars) txtstr += "%s = %.3fs" % ('elapsed time',timeit.default_timer() - start_time) print (txtstr) |