CIL icon indicating copy to clipboard operation
CIL copied to clipboard

TotalVariation proximal in place

Open MargaretDuff opened this issue 1 year ago • 1 comments

TotalVariation proximal is not calculated in place correctly. This was spotted when trying to run SIRT with a TV constraint in https://github.com/TomographicImaging/CIL/issues/1514.

data = dataexample.SIMPLE_PHANTOM_2D.get(size=(128,128))
plt.figure()
plt.imshow(data.as_array())
plt.show()
out=data.geometry.allocate('random')
TotalVariation().proximal(data, tau=1, out=out)
plt.figure()
plt.imshow(out.as_array())
plt.show()

gives image image

data = dataexample.SIMPLE_PHANTOM_2D.get(size=(128,128))
plt.figure()
plt.imshow(data.as_array())
plt.show()
TotalVariation().proximal(data, tau=1, out=data)
plt.figure()
plt.imshow(data.as_array())
plt.show()

gives image image

MargaretDuff avatar Jan 15 '24 15:01 MargaretDuff

Need to also test with strong convexity constant >0

MargaretDuff avatar Oct 01 '24 08:10 MargaretDuff