-
Notifications
You must be signed in to change notification settings - Fork 258
Refactor downbeats and add bar tracking #316
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
Conversation
26ae1d2 to
087c8c2
Compare
2222f6a to
66cc302
Compare
84bc0ef to
b0f698e
Compare
b0f698e to
eb6abd4
Compare
70192c5 to
9d24194
Compare
|
On the Ballroom set, interpolation has exactly 0 impact, thus I think we can safely remove it completely. |
|
Rebased on master after merging #322 solves the memory issue. |
9d24194 to
4e80be8
Compare
|
|
730f7d2 to
48a9177
Compare
48a9177 to
d8eb403
Compare
3691d5b to
d833ec7
Compare
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.
I think this is fine, although to be honest, I did not go through each change in detail (e.g. I did not check, if moving the Downbeat classes to a different module breaks something - I hope the tests catch that).
Besides that - good work 👍
| return np.log(self.probabilities) | ||
|
|
||
| @staticmethod | ||
| def make_dense(states, pointers, probabilities): |
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.
This does not relate to this PR directly, but I'm not sure if make_dense and make_sparse are good names here, because imho they just convert to/from different sparse representations of the transition matrix (CCO to CSR, see https://en.wikipedia.org/wiki/Sparse_matrix)...
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.
Yes, this is something which bothered me as well, especially since it doesn't become really dense, just a bit 'denser'. How about compress/de-compress instead? We can deprecate make_sparse then -- although I don't think a lot of people use it, since this is a rather low-level routine.
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.
I will still merge this PR as it is now, since there exists already a from_dense method, so this should be addressed jointly. Created issue #335.
|
|
||
| def __setstate__(self, state): | ||
| # TODO: old models have a 'hid_init' instead of an 'init' attribute | ||
| # remove this unpickling code after updating all models |
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.
I think we should track such ToDos in the issue tracker. ToDo items in code tend to be forgotten after some time... 😄
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.
I am not sure if all of these TODOs should go into the issue tracker, since there are plenty and some are simply not really urgent. However, I still mark them with TODO, since then at least Pylint lists them and they won't be forgotten completely.
0af2cba to
10596e0
Compare
This PR moves all downbeat & pattern tracking functionality into a separate
downbeatsmodule. It additionally adds bar tracking (i.e. track the downbeats given the beat positions) functionality.Although this PR is more or less ready, there are a couple of things to be discussed:RNNBarProcessorreturn a single 2D numpy array containing the beat times as the first column and the probability to be a downbeat position as the second column (eventually returning NaN as its last (or: first, see next point) value. EDIT: returns a 2D array withNaNas the last downbeat probability. This also enables us to simply save the bar activations.originparameter ofFramedSignal? EDIT: deferred for later (i.e. when implementing online downbeat trackers).beats_hmm.MultiPatternTransitionModelshould be parametrised, right now the parameters are kind of overlapping. EDIT: usetransition_probto be able to model transitions between patterns.features-namespace.CLPChromaProcessor). EDIT: (at least partially) fixed in prevent memory leak when accessing signal frames #322.