-
Notifications
You must be signed in to change notification settings - Fork 1.4k
WIP: Add GED transformer #13259
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
base: main
Are you sure you want to change the base?
WIP: Add GED transformer #13259
Conversation
Already have a failure but fortunately it's just a tol issue I think:
I would just bump the |
Thanks! It might be that the small difference between filters_ will propagate and increase in patterns_, so rtol/atol won't be much of help for patterns_. But let's see |
Different architectures, macos-13 is Intel x86_64 and macos-latest is ARM / M1. And Windows also failed, could be use of MKL there or something. I'm cautiously optimistic it's just floating point errors... |
@larsoner, I think I covered tests for the core GEDTransformer cases. Could you check that it's enough and I can move to the next step? |
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.
Great that the assert
statements are passing! Just a few comments below. Also, can you see if you can get closer to 100% coverage here?
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.
Just a couple more comments.
FYI I modified your top comment to have checkboxes (you can see how it's done if you go to edit it yourself) and a rough plan. Can you see if the plan is what you have in mind and update accordingly if needed? Then I can see where you (think you) are after your next push, and when you ask "okay to move on" I'll know what you want to do next 😄
Thanks Eric!
That's a cool tool, like that! Will do
Alright :) |
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Hi @larsoner! Is there anything else I should improve before moving on to the next steps? Also, could you please confirm that I'm not confused with these two?
|
I think this should be okay. Is the sorting by variance explained or something? Before they're sorted how are they ordered? If it's random for example it's fine to sort, but if it's not random and has some meaning them maybe we shouldn't store them sorted some other way...
Yes it sounds like it probably is. Best thing you can do is prove to yourself (and us in review 😄 ) that it's a bug by pushing a tiny test that would fail on |
They are stored sorted by descending eigenvalues by default. But I think given the
I pushed the test here, but how do I show you that it fails on Is there anything left to do before I can remove the asserts and clean up the classes? |
If this were true test-driven development (TDD) you could for example make this your first commit, show it failed on CIs, then proceed to fix it in subsequent commits. But in practice this isn't typically done and would be annoying to do here, so what I would suggest is that you take whatever tiny test segment should fail on
Currently I see a bunch of red CIs. So I would say yes, get those green first. An implicit sub-step of all steps is "make sure CIs are still green" before moving onto the next step (unless of course one of your steps someday is something like, "TDD: add breaking test and see CIs red" or whatever, but it's not that way here). Then proceeding with the plan in the top comment looks good to me, the next step of which is to remove the asserts, then redundant code, etc.! |
Of course, I checked that it fails before I even started implementing the fix. Thanks for the explanation!
Yeah, I rushed a bit with a comment before checking that everything's green :) I handled the major problem, but the failure I get now doesn't make much sense to me. The issue seems to be order-related (which is fair given my last commits), but it doesn't appear neither on my windows machine, nor on most of the CIs here. Is there a way to get a more elaborate traceback? |
What does this implement/fix?
Adds transformer for generalized eigenvalue decomposition (or approximate joint diagonalization) of covariance matrices.
It generalizes xdawn, csp, ssd, and spoc algorithms.
Additional information
Steps:
assert_allclose
calls in codeassert_allclose
calls in codeThen it should be ready for merge!