-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for multicoil autodiff in absence of Smaps #175
Conversation
@@ -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] |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this 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! : )
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.