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

Add support for multicoil autodiff in absence of Smaps #175

Merged
merged 22 commits into from
Aug 5, 2024

Conversation

chaithyagr
Copy link
Member

In the past we didnt work on this as we didnt anticipate it to be useful. But @alineyyy needs it so worked on it now.
Adding @alineyyy for review and comments.

@chaithyagr chaithyagr requested a review from alineyyy August 5, 2024 11:43
@@ -43,11 +43,11 @@ def backward(ctx, dy):
for size in im_size
]
grid_r = torch.meshgrid(*r, indexing="ij")
grid_r = torch.stack(grid_r, dim=0).type_as(x)[None, ...]
grid_r = torch.stack(grid_r, dim=0).type_as(x)[:, None]
Copy link
Contributor

Choose a reason for hiding this comment

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

That's really efficient in multiplying each coil with the grid! ( I thought we need to use some for loop before...

Copy link
Member Author

Choose a reason for hiding this comment

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

Haha, always use vectors :P

).reshape(img_data.shape)
adj_data_ndft = torch.matmul(
ndft_matrix(operator).conj().T, ksp_data.T
).T.reshape(img_data.shape)
Copy link
Contributor

Choose a reason for hiding this comment

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

To be honest, I am a little bit confused why @ has been replaced by the torch.matmul... Does torch.matmul cost less time or memory?

Copy link
Contributor

@alineyyy alineyyy left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for your work. It helps me a lot! : )

@chaithyagr chaithyagr merged commit 57765d5 into mind-inria:master Aug 5, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants