Skip to content
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

Test multi-coils in test_autodiff #139

Merged
merged 24 commits into from
Jun 27, 2024
Merged

Conversation

alineyyy
Copy link
Contributor

This will solve #131
Some new configurations about the multi-coils have been set.

@alineyyy alineyyy requested a review from chaithyagr June 24, 2024 14:37
@chaithyagr chaithyagr marked this pull request as draft June 24, 2024 14:41
@paquiteau paquiteau added the nufft-backend Issues regarding NUFFT backend support label Jun 25, 2024
@chaithyagr chaithyagr marked this pull request as ready for review June 26, 2024 14:07
Copy link
Member

@chaithyagr chaithyagr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this great work! Minor changes

grid_x = x * grid_r # Element-wise multiplication: x * r

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets not add unwanted space.

Comment on lines 53 to 59
grad_traj = torch.cat(
[torch.transpose((-1j * torch.conj(dy[:, i, :]) * nufft_dx_dom[:, i, :]), 0, 1)[None, ...] for i in range(dy.shape[1])],
dim=0,
)

grad_traj = torch.mean(grad_traj, dim=0).type_as(traj)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
grad_traj = torch.cat(
[torch.transpose((-1j * torch.conj(dy[:, i, :]) * nufft_dx_dom[:, i, :]), 0, 1)[None, ...] for i in range(dy.shape[1])],
dim=0,
)
grad_traj = torch.mean(grad_traj, dim=0).type_as(traj)
grad_traj = torch.mean(
[torch.transpose((-1j * torch.conj(dy[:, i, :]) * nufft_dx_dom[:, i, :]), 0, 1)[None, ...] for i in range(dy.shape[1])],
dim=0,
)

Maybe just have a single line

[torch.transpose((1j * y[i] * inufft_dx_dom[i]), 0, 1)[None, ...] for i in range(y.shape[0])],
dim=0,
)
grad_traj = torch.mean(grad_traj, dim=0).type_as(traj)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Member

@chaithyagr chaithyagr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor, yet urgent issue to be addressed.

@@ -32,14 +31,12 @@
(4, 2, True),
],
)

@parametrize_with_cases(
"kspace_loc, shape",
cases=[
CasesTrajectories.case_nyquist_lowmem_radial3D,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When did we make this as only 3D test? we need to change this back.

Copy link
Member

@chaithyagr chaithyagr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we can merge once green! Great work @alineyyy

Comment on lines +698 to 699
@with_numpy_cupy
def data_consistency(self, image_data, obs_data):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be @with_numpy

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be handled in #140 as we cannot test this right now.

@chaithyagr chaithyagr merged commit 4ab214c into master Jun 27, 2024
8 checks passed
@chaithyagr chaithyagr deleted the test_autodiff-multicoil branch June 27, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nufft-backend Issues regarding NUFFT backend support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants