Giter Club home page Giter Club logo

cdtw's People

Contributors

fzyukio avatar halachkin avatar johanneshk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cdtw's Issues

Support for sequences of vectors

Hi all,

It seems cdtw doesn't support running DTW with two sequences of feature vectors (e.g. MFCC). I get the following error:

Traceback (most recent call last):
  File "./s2f.py", line 161, in <module>
    d = U[b] - V
  File "./s2f.py", line 88, in __sub__
    compute_path = False)).get_dist()
  File "/my/path/to/python/python2.7/site-packages/cdtw/pydtw.py", line 12, in __init__
    cydtw.__init__(self, ref, query, settings)
  File "cdtw/cydtw.pyx", line 251, in cdtw.cydtw.cydtw.__init__ (cdtw/cydtw.c:4379)
  File "cdtw/cydtw.pyx", line 279, in cdtw.cydtw.cydtw._dtw (cdtw/cydtw.c:4989)
  File "/my/path/to/python/python2.7/site-packages/numpy/core/shape_base.py", line 278, in hstack
    return _nx.concatenate(arrs, 0)
ValueError: all the input arrays must have same number of dimensions

The code excerpt generating this error:

        return pydtw.dtw(this.stFeatures.T, that.stFeatures.T, pydtw.Settings(step = 'p0sym',     #Sakoe-Chiba symmetric step with slope constraint p = 0
                                window = 'palival', #type of the window
                                param = 2.0,        #window parameter
                                norm = False,       #normalization
                                dist='euclid',
                                compute_path = False)).get_dist()

this.stFeatures.T and that.stFeatures.T are numpy arrays and have shape (38, 13) and (65, 13) respectively.

Is this feature not supported or did I do something wrong?

Any help is appreciated, thank you!

TypeError : an integer is required error

I get this error with the speedtest and here.

(Pdb) dtw([1,2,3],[2,3,4],Settings(dist='manhattan', step = 'dp2', window = 'nowindow', compute_path = True))
*** TypeError: an integer is required

Create a pip package?

I wonder if you are interested in creating a package for pypi? That would be great, as it would greatly simplify installation (pip install cdtw) and usage.

Outdated Hyperlink to PDF

Readme.md:
The hyperlink of
"well known step patterns dp1, dp2, dp3"
does not link to the intended PDF.

set_type in test.py, and integer error

C:\Users\p\Downloads>python test.py
Traceback (most recent call last):
File "test.py", line 280, in
run(s,t)
File "test.py", line 63, in run
s.step.set_type('dp2')
AttributeError: Step instance has no attribute 'set_type'

C:\Users\p\Downloads>python test.py
Traceback (most recent call last):
File "test.py", line 280, in
run(s,t)
File "test.py", line 67, in run
d = dtw(ref,query,s)
File "C:\Users\ap\Downloads\cdtw\src\pydtw.py", line 11, in init
cydtw.init(self, ref, query, settings)
File "cydtw.pyx", line 250, in cydtw.cydtw.init (cydtw.c:4337)
self._dtw(ref, query, settings)
File "cydtw.pyx", line 259, in cydtw.cydtw._dtw (cydtw.c:4588)
c_dtw_settings.dist_type = settings.dist.get_cur_type_code()
TypeError: an integer is required

This is resolved with:
python setup.py build_ext --inplace --compiler=msvc

TEST PASSED
C:\Users\p\Downloads>python test.py
Ran 20 tests. 0 failures.

Error when I import pydtw

Hi,
I have an error when I import pydtw after the installation of cdtw:

from cdtw import pydtw

Return:
ImportError: cannot import name 'cydtw' from 'cdtw.cydtw' (unknown location)

Can anyone help me?

Different distances when compute_path=True/False?

Hi!

I don't understand the following behavior (code adapted from examples nb):

import numpy as np
import pydtw
t = np.arange(0,3*np.pi,0.2)
r = np.sin(t)
q = np.cos(1.2*t+1) + np.sin(t)
print(pydtw.dtw(r,q,pydtw.Settings(dist = 'manhattan', step  = 'dp2', window = 'nowindow', compute_path = True)).get_dist())
print(pydtw.dtw(r,q,pydtw.Settings(dist = 'manhattan', step  = 'dp2', window = 'nowindow', compute_path = False)).get_dist())

Output:

12.37014033416319
11.829838028295049

Why do I get different distance when setting compute_path to True or False? Shouldn't the distances be the same regardless (maybe I'm missing something...)?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.