diff --git a/examples/decomposition/plot_img_denoising.py b/examples/decomposition/plot_img_denoising.py index a89ae896ad7540979f65eb1c29c0f9e731b5718a..ceddb85a9bc274d03ac8198fcbbf7f9a8401a600 100644 --- a/examples/decomposition/plot_img_denoising.py +++ b/examples/decomposition/plot_img_denoising.py @@ -14,9 +14,9 @@ at the difference between the reconstruction and the original image. If the reconstruction is perfect this will look like gaussian noise. It can be seen from the plots that the results of :ref:`omp` with two -non-zero coefficients is a bit less biased than when keeping only one (the -edges look less prominent). However, it is farther from the ground truth in -Frobenius norm. +non-zero coefficients is a bit less biased than when keeping only one +(the edges look less prominent). It is in addition closer from the ground +truth in Frobenius norm. The result of :ref:`least_angle_regression` is much more strongly biased: the difference is reminiscent of the local intensity value of the original image. @@ -46,8 +46,7 @@ lena = sp.lena() / 256.0 # downsample for higher speed lena = lena[::2, ::2] + lena[1::2, ::2] + lena[::2, 1::2] + lena[1::2, 1::2] -lena = lena[::2, ::2] + lena[1::2, ::2] + lena[::2, 1::2] + lena[1::2, 1::2] -lena /= 16.0 +lena /= 4.0 height, width = lena.shape # Distort the right half of the image @@ -123,15 +122,13 @@ data -= intercept print 'done in %.2fs.' % (time() - t0) transform_algorithms = [ - ('Orthogonal Matching Pursuit\n1 atom', - 'omp', {'transform_n_nonzero_coefs': 1}), - ('Orthogonal Matching Pursuit\n2 atoms', - 'omp', {'transform_n_nonzero_coefs': 2}), - ('Least-angle regression\n5 atoms', - 'lars', {'transform_n_nonzero_coefs': 5}), - ('Thresholding\n alpha=0.1', 'threshold', - {'transform_alpha': .1}), -] + ('Orthogonal Matching Pursuit\n1 atom', 'omp', + {'transform_n_nonzero_coefs': 1}), + ('Orthogonal Matching Pursuit\n2 atoms', 'omp', + {'transform_n_nonzero_coefs': 2}), + ('Least-angle regression\n5 atoms', 'lars', + {'transform_n_nonzero_coefs': 5}), + ('Thresholding\n alpha=0.1', 'threshold', {'transform_alpha': .1})] reconstructions = {} for title, transform_algorithm, kwargs in transform_algorithms: