diff options
author | Daniil Kazantsev <dkazanc@hotmail.com> | 2018-05-12 19:03:26 +0100 |
---|---|---|
committer | Daniil Kazantsev <dkazanc@hotmail.com> | 2018-05-12 19:03:26 +0100 |
commit | d1875172687fc854df35fa9bfc6ac07a148d7f18 (patch) | |
tree | a93ede4c3e74262be654ffbecbd160f31409a04a /Wrappers/Python/wip | |
parent | 3d939a6139e664c3f8143031d0aaf765298efda5 (diff) | |
download | framework-plugins-d1875172687fc854df35fa9bfc6ac07a148d7f18.tar.gz framework-plugins-d1875172687fc854df35fa9bfc6ac07a148d7f18.tar.bz2 framework-plugins-d1875172687fc854df35fa9bfc6ac07a148d7f18.tar.xz framework-plugins-d1875172687fc854df35fa9bfc6ac07a148d7f18.zip |
fixed objective2
Diffstat (limited to 'Wrappers/Python/wip')
-rw-r--r-- | Wrappers/Python/wip/demo_compare_RGLTK_TV_denoising.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/Wrappers/Python/wip/demo_compare_RGLTK_TV_denoising.py b/Wrappers/Python/wip/demo_compare_RGLTK_TV_denoising.py index 0d57e5e..2bf1286 100644 --- a/Wrappers/Python/wip/demo_compare_RGLTK_TV_denoising.py +++ b/Wrappers/Python/wip/demo_compare_RGLTK_TV_denoising.py @@ -75,11 +75,13 @@ plt.title('CVX TV with objective equal to {:.2f}'.format(objectivetv_denoise.va plt.show() print(objectivetv_denoise.value) -#%% THen FBPD - +#%% # Data fidelity term f_denoise = Norm2sq(I,y,c=0.5) +#%% + +#%% THen FBPD # Initial guess x_init_denoise = ImageData(np.zeros((N,N))) @@ -112,9 +114,7 @@ xtv_rof = g_rof.prox(y,1.0) print("CCPi-RGL TV ROF:") plt.figure() plt.imshow(xtv_rof.as_array()) -valObjRof = g_rof(xtv_rof) -data_energy = 0.5*np.sum(np.power((xtv_rof.as_array() - y.array),2)) -EnergytotalROF = data_energy + 0.5*valObjRof[0] +EnergytotalROF = f_denoise(xtv_rof) + g_rof(xtv_rof) plt.title('ROF TV prox with objective equal to {:.2f}'.format(EnergytotalROF)) plt.show() print(EnergytotalROF) @@ -127,9 +127,7 @@ xtv_fgp = g_fgp.prox(y,1.0) print("CCPi-RGL TV FGP:") plt.figure() plt.imshow(xtv_fgp.as_array()) -valObjFGP = g_fgp(xtv_fgp) -data_energy = 0.5*np.sum(np.power((xtv_fgp.as_array() - y.array),2)) -EnergytotalFGP = data_energy + 0.5*valObjFGP[0] +EnergytotalFGP = f_denoise(xtv_fgp) + g_fgp(xtv_fgp) plt.title('FGP TV prox with objective equal to {:.2f}'.format(EnergytotalFGP)) plt.show() print(EnergytotalFGP) @@ -141,9 +139,7 @@ xtv_sb = g_sb.prox(y,1.0) print("CCPi-RGL TV SB:") plt.figure() plt.imshow(xtv_sb.as_array()) -valObjSB = g_sb(xtv_sb) -data_energy = 0.5*np.sum(np.power((xtv_sb.as_array() - y.array),2)) -EnergytotalSB = data_energy + 0.5*valObjSB[0] +EnergytotalSB = f_denoise(xtv_sb) + g_fgp(xtv_sb) plt.title('SB TV prox with objective equal to {:.2f}'.format(EnergytotalSB)) plt.show() print(EnergytotalSB) |