5 releases

0.9.5 Jul 19, 2023
0.9.4 Jul 19, 2023

#20 in #dynamic-programming

Custom license

280KB
481 lines

DTW_RS

A Dynamic Time Warping (DTW) library for Rust

Computation methods:

  • Dynamic programming
  • Dynamic programming with the Sakoe-Chuba Band
  • Dynamic programming with the Itakura Parallelogram (future plan)
  • FastDTW (future plan)

Install:

cargo add dtw_rs

Usage:

use dtw_rs::{Algorithm, DynamicTimeWarping};

let a = [1.0, 3.0, 9.0, 2.0, 1.0];
let b = [2.0, 0.0, 0.0, 8.0, 7.0, 2.0];

let dtw = DynamicTimeWarping::between(&a, &b);

println!("Distance: {}, Path: {:?}", dtw.distance(), dtw.path());


lib.rs:

DTW_RS

A Dynamic Time Warping (DTW) library for Rust

Computation methods:

  • Dynamic programming
  • Dynamic programming with the Sakoe-Chuba Band
  • Dynamic programming with the Itakura Parallelogram (future plan)
  • FastDTW (future plan)
use dtw_rs::{Algorithm, DynamicTimeWarping};

let a = [1.0, 3.0, 9.0, 2.0, 1.0];
let b = [2.0, 0.0, 0.0, 8.0, 7.0, 2.0];

let dtw = DynamicTimeWarping::between(&a, &b);

println!("Distance: {}, Path: {:?}", dtw.distance(), dtw.path());

No runtime deps