Repository navigation
fix: conjugate U and Vh in the vectorial birefringence inverse filter - #601
Open
talonchandler wants to merge 1 commit into
Open
talonchandler wants to merge 1 commit into
talonchandler wants to merge 1 commit into
Conversation
The Tikhonov filter in inplane_oriented_thick_pol3d_vector was built as einsum(U, S_reg, Vh); the least-squares inverse of the forward model needs conj(U) and conj(Vh). The model's transfer function is complex and not Hermitian-symmetric, so unlike the scalar thin models nothing masks the error: the unconjugated operator is not the pseudoinverse (200% operator error against torch.linalg.pinv; the conjugated filter matches pinv to float32 roundoff) and the recovered f00 phase channel came back sign-flipped (star-phantom Pearson r -0.74 before, +0.73 after). Same root cause as #598, split from #600 because it changes birefringence outputs and needs its own release note. Adds an operator-level pseudoinverse test and a phantom round-trip test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same root cause as #598, split from #600 because it changes birefringence outputs and deserves its own release note.
What
One line in
inplane_oriented_thick_pol3d_vector.apply_inverse_transfer_function: build the Tikhonov filter fromconj(U)andconj(Vh). For the forward model the least-squares inverse needs the conjugates.Why it matters here
Unlike the scalar thin models, nothing masks the error: this model's transfer function is complex and not Hermitian-symmetric (asymmetry 0.14 at 5-State, NA 0.5/1.2). The unconjugated operator is not the pseudoinverse (200% operator error against
torch.linalg.pinv; the conjugated filter matches pinv to float32 roundoff), and the recovered f00 phase channel comes back sign-flipped (star-phantom Pearson r -0.74 before, +0.73 after; the f2-2/f22 anisotropy channels improve from r 0.33/0.29 to 0.73/0.71).Tests
test_inverse_filter_is_tikhonov_pseudoinverse: the applied filter must equal the independently built Tikhonov pseudoinverse at sampled frequencies.test_round_trip_recovers_phantom: forward then inverse recovers the star phantom with positive correlation per channel.Impact
Any pipeline using this model sees changed output (that is the fix: the old phase channel had the wrong sign). Release notes should call this out for birefringence users.