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

Fix NDFT tests #96

Merged
merged 12 commits into from
Apr 29, 2024
Merged

Fix NDFT tests #96

merged 12 commits into from
Apr 29, 2024

Conversation

chaithyagr
Copy link
Member

@chaithyagr chaithyagr commented Apr 26, 2024

The fixes include:

  1. fftshift added for FFT <-> NDFT matrix test
  2. Added a test to compare NDFT vs NUFFT. This is crucial and sets the tone for autodiff modules.
  3. Adding normalize to support ortho, this is important as mostly all NUFFT is normalized.
  4. Removed a test test_ndft_grid_matrix, which tries o get the FFT matrix and match to a gridded NDFT matrix. But this is too complex and not generalizable currently. The test seems redundant so I removed it.

@chaithyagr chaithyagr requested a review from paquiteau April 26, 2024 12:47


@parametrize_with_cases(
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is bad. Removed it :P

@@ -76,7 +53,32 @@ def test_ndft_implicit1(kspace, shape):
linop_coef = implicit_type1_ndft(kspace, random_kspace.flatten(), shape)
matrix_coef = matrix.conj().T @ random_kspace.flatten()

assert np.allclose(linop_coef, matrix_coef)
assert_almost_allclose(linop_coef, matrix_coef, atol=1e-4, rtol=1e-4, mismatch=5)
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is good, so added it :P

@paquiteau
Copy link
Member

Good catch ! could you detail a bit which things were wrong (and why) ?
Also, lint your code ;)

@chaithyagr
Copy link
Member Author

@paquiteau Ill let you add this test for CD! I think that its good practice to run it before every release. (More importantly, we need to make it run right now to make sure the tests run fine.)

@chaithyagr
Copy link
Member Author

Can i merge when green? @paquiteau

@paquiteau paquiteau merged commit 93f7c3f into mind-inria:master Apr 29, 2024
8 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.

2 participants