-
Notifications
You must be signed in to change notification settings - Fork 323
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
[WIP] Fix #639 Top-K Nearest Neighbors to Matrix Profile (normalize=False) #714
[WIP] Fix #639 Top-K Nearest Neighbors to Matrix Profile (normalize=False) #714
Conversation
Codecov ReportBase: 99.90% // Head: 99.90% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #714 +/- ##
========================================
Coverage 99.90% 99.90%
========================================
Files 80 80
Lines 12289 12719 +430
========================================
+ Hits 12277 12707 +430
Misses 12 12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@seanlaw After you review these changes and show the greenlight, I will push the next set of commits for another module. (please ignore |
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.
@NimaSarajpoor I quickly glanced over it but didn't see anything that stood out. I trust that there isn't much that will be tricky here but please draw my attention to specific parts if you want me to really turn on my "eagle eyes". Otherwise, I'm going to rely on the unit tests to guide me (of course, your changes to the naive.py
could affect things).
Sure. I will keep that in mind.
I will try to be careful and I always open the normalized modules to make sure we are consistent in the changes we are going to make for top-k support. If I notice there is something unique in non-normalized version, I will let you know for sure. |
@seanlaw There is one small concern that I would like to share with you... In some of the new test functions (related to top-k) in
(e.g. see Note that in the normalized version (i.e. I was wondering if this is okay with you? As an alternative approach, I can break down this nested for-loop as follows:
|
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.
@NimaSarajpoor While the triple for-loop isn't my favorite, it seems okay. Please proceed
@seanlaw |
Up to you. What do you think? Minimally we need full coverage |
@seanlaw |
Apparently , we already had the test for I will now start comparing the computing time. |
@seanlaw "Each of the top-k neighbors of a sequence Please ignore this suggestion if it makes the docstrings more confusing :) |
I get your point. How about this:
|
Yeah, I was thinking about that the other day but wasn't in front of my computer to check. It makes sense though that we'll simply need to move the tests over. This is good. It means that we've been proactive and "Future Nima thanks past Nima for thinking ahead and making his life easier" 😄 You are developing good habits and you'll have confidence in your own development approach and you'll find that it is more and more rare for there to be a huge mistake/bug if you've protected yourself sufficiently. More importantly, it means that it'll be harder for other people to break things. |
Yes... your suggestion is cleaner as it specifically talks about the case
😄
True! Since we take care of things in the first place, we will face less issue. Even if we face one, it will be easier to resolve it :) 👍 |
sneak peek on computing time :)
|
In the following tables, length of subsequence, aamp: ok
aamped: ok
(!!!) gpu_aamp: NOT ok (see n=50k, 100k)
prescraamp: ok
scraamp_update: Not ok ?!
aampi: ok
I will investigate |
919ec76
to
e58dffd
Compare
32810fb
to
7d74c45
Compare
@seanlaw aamp
aamped
gpu_aamp
aampi(egress=True) with 5 updates
aampi(egress=False) with 5 updates
prescraamp
scraamp (prescraamp==False) with 5 updates
NOTE: I think everything is good :) Please feel free to review. |
Can you please describe what the issue was? I am curious if it was simply a bug or did we have to do something drastically different from the normalized version. My main concern is maintaining consistency across normalized and non-normalized methods. |
@NimaSarajpoor So far, everything looks good to me and nothing obvious stood out. Is there anything else left to be done? |
I reviewed the code to just show you the parts that are related to
I think everything is good. The only thing you may want to do is to just scan the docstrings to make sure everything is correct. |
I can do that! |
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 minor suggestion
@NimaSarajpoor Thanks again for this contribution! |
This PR addresses #639 . This is a follow up to PR #595.
We are going to add top-k support for the following modules:
Issues Tracker (so that we do not forget)
scraamp
(andscrump
), the following if-block is (probably?) never executedscraamp
, we may doif-continue
in the if block below to avoid computing the rest of code