-
Notifications
You must be signed in to change notification settings - Fork 106
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
adjoint in odl.tomo.RayTransform is incorrect #1646
Comments
ODL's adjoint is not with respect to the inner product given by "torch.sum(y*x)" but rather y.inner(x). |
Many thanks. For my understanding, the results of inner product should give us a scalar? So Definition of inner product: https://en.wikipedia.org/wiki/Inner_product_space. |
Sorry, I can't follow your argument regarding scale. I don't know from the top of my head what In any case, if you want to have that ODL computes the adjoint with respect to the inner product of torch, you could just compute constant scaling factors
Note, that I haven't tested the code above but hopefully you get the idea. |
Thanks. For my understanding, for any forward model |
with "scale", you mean scalar https://en.wikipedia.org/wiki/Scalar_(mathematics)? |
yeah, sorry about the typo error. I corrected the word. |
Hi, The definition of the inner product in L2 function space is <f, g> = \int f(x) g(x) dx. |
Thank you so much. Suppose we worked on the 2D case and the image size is [m, n] and the size of the measurements is [nviews,detector_size]. Then, we should have <Ax,y>(nviewsdetector_size)= <x,A^T y>(mn). -- x represents the image and y denotes the measurements. If my understanding is correct, then looks the ``='' is still not held. Or is it possible for you to show me one example that <Ax, y > * A.range.cell_volume = <x, A^T y> * A.domain.cell_volume is held for a given geometry but different image size, nviews, detector_size? I think this would help me a lot. Thank you so much. |
If A = odl.tomo.RayTransform(reco_space, geometry), then use A.range.cell_volume and A.domain.cell_volume. Here, domain and range are input and output spaces of your operator. When you define the ray transform, you provide the domain (reco_space), range is computed automatically. space.cell_volume = product of space.cell_sides. Space.cell_sides = ( space.max_pt - space.min_pt) / space.shape |
It works now. Thank you so much. This really helps. :) |
The forward and adjoint operators are incorrect by using the following commands:
ray_trafo = odl.tomo.RayTransform(reco_space, geometry)
proj_data = ray_trafo(phantom)
backproj = ray_trafo.adjoint(proj_data)
check:
y = torch.randn_like(proj_data)
torch.sum(y* proj_data) \neq torch.sum( ray_trafo.adjoint(y)* phantom)
for different number of views.
The text was updated successfully, but these errors were encountered: