Commit 6feba67b authored by Franck Thollard's avatar Franck Thollard
Browse files

adding check capability

parent dff57cdc
from pathlib import Path
from invoke import task
import numpy as np
here = Path(__file__).parent.absolute()
......@@ -19,6 +20,18 @@ def build(c):
if (path / "Makefile").exists():"cd {path} && make", echo=True)
def check(c):
ref_dtw = np.load("ref_small_dtw.npy")
ref_cort = np.load("ref_small_cort.npy")
for path in directories:"cd {path} && ./ -s res", echo=True)
calc_dtw = np.load(f"{path / 'res_dtw.npy'}")
print(f"{} dtw : allclose {np.allclose(ref_dtw, calc_dtw)}")
calc_cort = np.load(f"{path / 'res_cort.npy'}")
print(f"{} cort: allclose {np.allclose(ref_cort, calc_cort)}")
def bench(c, medium=False):
......@@ -33,6 +33,9 @@ def main(compute, only_init=False):
"-n", type=int, default=None, help="number of series (default all 200)"
"-s", type=str, default=None, help="save the matrices (provide prefixes)"
"-v", action="store_true", default=None, help="visualize the matrix"
......@@ -55,12 +58,18 @@ def main(compute, only_init=False):
_dist_mat_dtw, _dist_mat_cort = compute(series, nb_series)
print("elapsed time = {:.3f} s".format(time() - t0))
if args.s:
dtw_mat = "{}_dtw".format(args.s), _dist_mat_dtw)
cort_mat = "{}_cort".format(args.s), _dist_mat_cort)
if args.v:
import matplotlib.pyplot as plt
fig, axes = plt.subplots(2)
cax0 = axes[0].imshow(_dist_mat_dtw,
cax1 = axes[1].imshow(_dist_mat_cort,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment