-
Notifications
You must be signed in to change notification settings - Fork 266
Description
I have some issues about
madmom -> features -> beat_hmm.py => RNNBeatTrackingObservationModel => log_densities (marked by *** ...**** below):
def log_densities(self, observations):
"""
Compute the log densities of the observations.
Parameters
----------
observations : numpy array, shape (N, )
Observations (i.e. 1D beat activations of the RNN).
Returns
-------
numpy array, shape (N, 2)
Log densities of the observations, the columns represent the
observation log probability densities for no-beats and beats.
"""
# init densities
log_densities = np.empty((len(observations), 2), dtype=np.float)
# Note: it's faster to call np.log 2 times instead of once on the whole 2d array
****
log_densities[:, 0] = np.log((1. - observations) /
(self.observation_lambda - 1))
log_densities[:, 1] = np.log(observations) ****
# return the densities
return log_densities
=> The formula in *** ...****
(1. - observations) /
(self.observation_lambda - 1)
corresponds to eq (3)
P(a_k | phi_k) = a_k if 1<= phi_k <= PHI/lambda;
(1-a_k)/(lambda-1) otherwise
in paper "A MULTI-MODEL APPROACH TO BEAT TRACKING CONSIDERING
HETEROGENEOUS MUSIC STYLES", 2014.
But this observation prob is not normalized either in paper or in the code.
I could not find any place where this prob is normalized.
Could you tell me where this prob is normalized?
Or, is it OK that this observation prob is not normalized, say in the Viterbi algorithm?