Giter Site home page Giter Site logo

dtw-numba's Introduction

dtw-numba

Warning

Work in progress. Just copy and inspect code from dtw_numba/__init__.py if you want to use it. Feel free to give feedback by writing an issue.

Another dynamic time warping (DTW) implementation, but this one is actually simple and fast. Unlike the alternatives, this library is written in Python with just Numpy and Numba. No overcomplicated and unreadable compiled C or Rust code in here, but better performance anyway.

In my experience, the best performing Python DTW implementation for high-dimensional data is dtw-python. dtw-numba aims to be compatible with dtw-python, and functionality and performance is tested against it. Please write an issue with your own benchmark results if you disagree.

The current implementation is minimal, but equivalent to dtw-python distance with default arguments. But speed is (depending on dimensionality) 20 to 300 times as fast.

Context

Python is slow, even with Numpy. Everything that needs to be fast is written in C, C++ or Rust, but I dislike that for various performance, debugging, transparancy and development reasons. Mojo should solve these issues, but it is in early development. I will write a Mojo DTW package, but before that I wrote/am writing this Numba version as a baseline.

My idea was that I would write a simple Numba implementation that would probably not be faster than the "optimized" low-level libraries, and then port it to Mojo for better performance. Turns out my implementation is faster than these other libraries. Numba has its own problems, but it does not fail to deliver performance on simple algorithms like DTW.

Benchmarks

Will be added later.

dtw-numba's People

Contributors

wietsedv avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.