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

fastdtw fails with multidimansional arrays #8

Open
00sapo opened this issue Oct 30, 2019 · 0 comments
Open

fastdtw fails with multidimansional arrays #8

00sapo opened this issue Oct 30, 2019 · 0 comments

Comments

@00sapo
Copy link

00sapo commented Oct 30, 2019

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)
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

1 participant