-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting up Sum of Weighted Convolutions Forward Operator #441
Comments
I think what you want is a spatially-weighted sum of convolutions of a single image, whereas the CSC problem involves a sum of convolutions of a number of matched filter-image pairs. As in the CSC problem example that you referenced, you should be able to construct the forward operator you need by composing |
Thanks @bwohlberg , and what about I see that the implementation of the optimization problem in case of With I did that by just defining the forward operator using im_jx = jax.device_put(im_s)
psf_jx = jax.device_put(psf2_cropped)
C = linop.CircularConvolve(h=psf_jx, input_shape=im_jx.shape, h_center=[psf_jx.shape[0] // 2, psf_jx.shape[1] // 2])
Cx = C(im_jx)
# PDHG
f = loss.SquaredL2Loss(y=Cx, A=C)
lbd = 5e-1#50 # L1 norm regularization parameter
g = lbd * functional.L21Norm()
D = linop.FiniteDifference(input_shape=im_jx.shape, circular=True)
maxiter = 50
tau, sigma = PDHG.estimate_parameters(D, factor=1.5)
solver_pdhg = PDHG(
f=f,
g=g,
C=D,
tau=tau,
sigma=sigma,
maxiter=maxiter,
itstat_options={"display": True, "period": 10},
)
print(f"Solving on {device_info()}\n")
x = solver_pdhg.solve()
hist = solver.itstat_object.history(transpose=True)
plt.subplot(121); plt.imshow(im_jx); plt.title('Blurred image')
plt.subplot(122); plt.imshow(x); plt.title(f'Recovered Image; PDHG: lambda: {lbd}, iter: {maxiter}, tau: {tau}'); However, I'm getting this
|
Discussion moved to #443; closing this issue. |
I'm trying to solve an implementation of the space-"variant" deconvolution algorithm presented in Flicker & Rigaut (2005) and reviewed here. The optimization problem can be written like so, where the forward model is a sum of weighted convolutions:
![image](https://private-user-images.githubusercontent.com/4764586/265558247-f9ac53e1-cd00-490b-8533-1bc5ec836390.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2MTQ3ODgsIm5iZiI6MTcyMTYxNDQ4OCwicGF0aCI6Ii80NzY0NTg2LzI2NTU1ODI0Ny1mOWFjNTNlMS1jZDAwLTQ5MGItODUzMy0xYmM1ZWM4MzYzOTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjJUMDIxNDQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTRjNDIzMWIwOWQ4NDUxN2QwOWExMTQzOGNkYzk2OTA5MDIyMjQ1M2FmNTg1ZWZiZGIxOTNmOTNkNWMyODlhZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.PKRTacAxeizU3PPss-1E2kQX1tXLXCg-TcEpAs8UAig)
The kernels,
U
, and weights,W
, are given by the right and left singular vectors respectively of the matrix formed by stacking the flattened PSFs sampled over the field of view.The closest representative example that I found on
scico
's website to assist with implementation seems to be Convolutional Sparse Coding, here.I understand that we have to define operators and corresponding functionals. However, I'm struggling to define the forward operator, possibly as a standalone function, that takes image, kernels, and weights,
x
,U
andW
, and describes the forward model usingCircularConvolve()
operator. Would you please help?The text was updated successfully, but these errors were encountered: