GithubHelp home page GithubHelp logo

timewarp.jl's Introduction

TimeWarp.jl

Build Status License Project Status: Unsupported - The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired.

Dynamic Time Warping (DTW) and related algorithms in Julia.

This package isn't officially registered. Install using:

Pkg.clone("https://github.com/ahwillia/TimeWarp.jl.git")

Related Packages in Other Languages

Acknowledgements

Special thanks to Joseph Fowler (@joefowler) who contributed a substantial portion of this code.

timewarp.jl's People

Contributors

ahwillia avatar holgerteichgraeber avatar joefowler avatar maetshju avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

timewarp.jl's Issues

Add a dependency on TimeSeries.jl

TimeSeries.jl looks like a mature and well-maintained package. It would be nice to leverage what they've done. In particular, the Sequence typealias might be replaced with the TimeSeries type.

On the other hand, it could be simpler / easier to just apply dtw on both raw Arrays. So this package should probably just support both.

Register in METADATA

A vert short checklist before submitting to METADATA:

  • basic documentation
  • add UCR datasets
  • add dba function
  • working example for dba (not sure how to test rigorously)
  • tests for fastdtw
  • tests for type stability

I'm going to wait until the v0.5 release to submit.

fastdtw function is slower than in DynamicTimeWarping.jl

Hi there!

It makes me really happy that this package exists because I've been getting frustrated with the speed of using dynamic time warping on large datasets in Python. While I was comparing this package to the older DynamicTimeWarp.jl package, I found that the fastdtw function is slower here than it is in the older package. I'm a little confused about why this might be, because my understanding is that this package is based on DynamicTimeWarp.jl.

When I time the fastdtw functions using the @btime macro from BenchmarkTools.jl, I get approximately 14 ms for the function from DynamicTimeWarp.jl, and approximately 76 ms for the function from TimeWarp.jl.

This is the script, assuming you have two sounds "sound1.wav" and "sound2.wav":

using TimeWarp, DynamicTimeWarp, BenchmarkTools, Compat, WAV

s1, sf1 = wavread("sound1.wav", format="double")
s2, sf2 = wavread("sound2.wav", format="double")

s1 = reshape(s1, size(s1)[1])
s2 = reshape(s2, size(s2)[1])

@btime DynamicTimeWarp.fastdtw($s1, $s2, 1) # 14 ms
@btime TimeWarp.fastdtw($s1, $s2, 1) # 76 ms

I was just wondering if this is expected behavior, or if there might be a simple fix for this.

fastdtw fails with multidimansional arrays

Hello,
I'm completely new to Julia, so my solution is not probably the best.

  1. in fastdtw.jlsubstitute lines 8-13 (fastdtw signature) with:
function fastdtw(
        seq1::AbstractArray,
        seq2::AbstractArray,
        radius::Int,
        dist::SemiMetric=SqEuclidean()
    )

    if !isa(seq1, Sequence)
        seq1 = Sequence(seq1)
    end
    if !isa(seq2, Sequence)
        seq2 = Sequence(seq2)
    end

And compress2 function (line 94):

function compress2(seq::Sequence)
    # Navg = div(length(seq), 2)
    evenseq = 0.5*(seq[1:2:end-1]+seq[2:2:end])
    if length(seq)%2 == 1
        return Sequence(hcat(evenseq, seq[end]))
    end
    Sequence(evenseq)
end
  1. in dtw.jl line 54 substitute:
D = zeros(T, m, n)

with

D = zeros(eltype(T), m, n)

Better Plotting Capabilities

The dtw package in R has some nice ideas for visualizing fits. Would be nice to have similar functionality here:

screen shot 2016-08-27 at 5 02 32 pm

screen shot 2016-08-27 at 5 02 41 pm

Toni Giorgino (2009). Computing and Visualizing Dynamic Time Warping Alignments in R: The dtw Package. Journal of Statistical Software, 31(7), 1-24, doi:10.18637/jss.v031.i07.

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.