680f1d6517d3598b1fe39bbb548d783839547a79,librosa/beat.py,,tempo,#,204

Before Change


    bpms = core.tempo_frequencies(tg.shape[0], hop_length=hop_length, sr=sr)

    // Weight the autocorrelation by a log-normal distribution
    prior = np.exp(-0.5 * ((np.log2(bpms) - np.log2(start_bpm)) / std_bpm)**2)

    // Kill everything above the max tempo
    if max_tempo is not None:
        max_idx = np.argmax(bpms < max_tempo)

After Change


    // it would also make time aggregation much more natural

    // Get the maximum, weighted by the prior
    best_period = np.argmax(np.log(tg + 1e-10) + logprior[:, np.newaxis], axis=0)

    tempi = bpms[best_period]
    // Wherever the best tempo is index 0, return start_bpm
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: librosa/librosa
Commit Name: 680f1d6517d3598b1fe39bbb548d783839547a79
Time: 2019-08-18
Author: brian.mcfee@nyu.edu
File Name: librosa/beat.py
Class Name:
Method Name: tempo


Project Name: suavecode/SUAVE
Commit Name: 7f9976d67c9b413b3a7211bad921b29eac7be179
Time: 2016-02-01
Author: jmvegh@stanford.edu
File Name: trunk/SUAVE/Methods/Power/Battery/Sizing/initialize_from_energy_and_power.py
Class Name:
Method Name: initialize_from_energy_and_power


Project Name: havakv/pycox
Commit Name: 1acd73180af489c1ebaf50cee3e6245e824a174a
Time: 2018-03-09
Author: kvamme@samba8.ad.nr.no
File Name: pycox/cox.py
Class Name: CoxNNT
Method Name: compute_loss


Project Name: NVIDIA/sentiment-discovery
Commit Name: 72fd5cbdee6043e4204f39f3764b113bdf1a1513
Time: 2018-08-13
Author: raulp@dbcluster.nvidia.com
File Name: main.py
Class Name:
Method Name: train