Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@superbock
Copy link
Collaborator

@superbock superbock commented Jul 25, 2017

This PR moves all downbeat & pattern tracking functionality into a separate downbeats module. 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:

  • Should RNNBarProcessor return 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 with NaN as the last downbeat probability. This also enables us to simply save the bar activations.
  • If we return the same number of downbeat probabilities as beat positions, should these probabilities be based on the features of the following beat period (as it is now) or on the one which just passed? Or: should these be aligned differently, e.g. centred? EDIT: features are centred around the beat (or interpolated subdivision) and num_subdivision features (for the current) beat are returned. We might change this for online mode, however.
  • Should the position of the window to aggregate/summarise the features around the (sub-)beat positions/divisions be coupled with the origin parameter of FramedSignal? EDIT: deferred for later (i.e. when implementing online downbeat trackers).
  • Check the impact/usefulness of interpolating missing values when synchronising features. EDIT: removed, since no difference was observed.
  • Decide how pattern transitions in beats_hmm.MultiPatternTransitionModel should be parametrised, right now the parameters are kind of overlapping. EDIT: use transition_prob to be able to model transitions between patterns.
  • Fix inability to transition between patterns with more than 1 entry state.
  • Decide which classes to import into the features-namespace.
  • Find and fix memory leak (suspect: CLPChromaProcessor). EDIT: (at least partially) fixed in prevent memory leak when accessing signal frames #322.

@superbock superbock force-pushed the refactor_downbeats branch 9 times, most recently from 26ae1d2 to 087c8c2 Compare July 27, 2017 13:41
@superbock superbock force-pushed the refactor_downbeats branch 4 times, most recently from 2222f6a to 66cc302 Compare August 4, 2017 15:56
@superbock superbock requested a review from flokadillo August 4, 2017 16:45
@superbock superbock changed the title [WIP] Refactor downbeats Refactor downbeats and add bar tracking Aug 4, 2017
@superbock superbock force-pushed the refactor_downbeats branch 4 times, most recently from 84bc0ef to b0f698e Compare August 6, 2017 14:41
@superbock superbock mentioned this pull request Aug 6, 2017
@superbock superbock mentioned this pull request Aug 10, 2017
@superbock superbock force-pushed the refactor_downbeats branch 2 times, most recently from 70192c5 to 9d24194 Compare August 11, 2017 10:45
@superbock
Copy link
Collaborator Author

superbock commented Aug 11, 2017

On the Ballroom set, interpolation has exactly 0 impact, thus I think we can safely remove it completely.

@superbock
Copy link
Collaborator Author

Rebased on master after merging #322 solves the memory issue. CLPChromaProcessor makes heavy use of FramedSignal which in turn triggered the slice memory/reference leak.

@superbock
Copy link
Collaborator Author

superbock commented Aug 14, 2017

MultiPatternStateSpace and MultiPatternTransitionModel use different arguments than their beat and bar counterparts. Should we change this to be more consistent with the others or keep it as it is?

@superbock superbock force-pushed the refactor_downbeats branch 2 times, most recently from 730f7d2 to 48a9177 Compare August 16, 2017 08:28
@superbock superbock force-pushed the refactor_downbeats branch 7 times, most recently from 3691d5b to d833ec7 Compare September 18, 2017 19:38
@superbock superbock requested a review from fdlm September 19, 2017 08:34
Copy link
Contributor

@fdlm fdlm left a 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):
Copy link
Contributor

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)...

Copy link
Collaborator Author

@superbock superbock Sep 19, 2017

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.

Copy link
Collaborator Author

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
Copy link
Contributor

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... 😄

Copy link
Collaborator Author

@superbock superbock Sep 19, 2017

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.

@superbock superbock merged commit b8306ed into master Sep 19, 2017
@superbock superbock deleted the refactor_downbeats branch September 19, 2017 11:52
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.

3 participants