Skip to content

Commit

Permalink
Merge c1e90b4 into c053d9e
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-balke committed Jul 26, 2016
2 parents c053d9e + c1e90b4 commit 29f83fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions librosa/core/dtw.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def fill_off_diagonal(x, radius, value=0):
x[idx_l] = value


def dtw(X, Y, dist='euclidean', step_sizes_sigma=None,
def dtw(X, Y, metric='euclidean', step_sizes_sigma=None,
weights_add=None, weights_mul=None, subseq=False, backtrack=True,
global_constraints=False, band_rad=0.25):
'''Dynamic time warping (DTW).
Expand All @@ -96,7 +96,7 @@ def dtw(X, Y, dist='euclidean', step_sizes_sigma=None,
Y : np.ndarray [shape=(K, M)]
audio feature matrix (e.g., chroma features)
dist : str
metric : str
Identifier for the cost-function as documented
in `scipy.spatial.cdist()`
Expand Down Expand Up @@ -182,7 +182,7 @@ def dtw(X, Y, dist='euclidean', step_sizes_sigma=None,
max_1 = step_sizes_sigma[:, 1].max()

# calculate pair-wise distances
C = cdist(X.T, Y.T, dist)
C = cdist(X.T, Y.T, metric)

if global_constraints:
# Apply global constraints to the cost matrix
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dtw.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_dtw_global_diagonal():

gt_wp = list(zip(list(range(10)), list(range(10))))[::-1]

mut_D, mut_wp = librosa.dtw(X, Y, subseq=True, dist='cosine',
mut_D, mut_wp = librosa.dtw(X, Y, subseq=True, metric='cosine',
step_sizes_sigma=np.array([[1, 1]]),
weights_mul=np.array([1, ]))

Expand Down

0 comments on commit 29f83fc

Please sign in to comment.