Skip to content
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

No-beat log density of RNNDownBeatTrackingObservationModel can be invalid #489

Closed
omareldeeb opened this issue Nov 30, 2021 · 1 comment
Closed

Comments

@omareldeeb
Copy link

Expected behaviour

Log densities of the observations should be valid, non-inf, and non-nan floating-point numbers.

Actual behaviour

If np.sum(observations, axis=1) is greater than 1, the log of a negative number is attempted to be calculated in line 629 of beats_hmm.py, causing a nan to be stored in log_densities. This behavior causes the viterbi algorithm to potentially fail.

Steps needed to reproduce the behaviour

import madmom
import numpy as np
import scipy

beat_decoder = madmom.features.downbeats.DBNDownBeatTrackingProcessor(fps=100.0,
                                                                      correct=True,
                                                                      beats_per_bar=4)
beat_activation = np.random.uniform(0, 1, 100)
downbeat_activation = np.random.uniform(0, 1, 100)
observations = np.dstack((beat_activation, downbeat_activation))[0]

print(beat_decoder.hmms[0].observation_model.log_densities(observations))

Information about installed software

madmom version: '0.16.1'
numpy version: '1.19.5'
scipy version: '1.7.2'

@superbock
Copy link
Collaborator

The observations (including the observations for non-beat states) have to be a probability density function in order to work with DBNDownBeatTrackingProcessor. Thus your observations are not suitable for DBNDownBeatTrackingProcessor. I will update the documentation to be more clear about that.

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

No branches or pull requests

2 participants