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

Improve gak #514

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a test where gak is working without overflow for constant time se…
…ries equal to zero of length 405
  • Loading branch information
YannCabanes committed Apr 4, 2024
commit c966e3f4c209070761d899eb420de8d3ad52845d
5 changes: 5 additions & 0 deletions tslearn/tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ def test_gak():
for array_type in array_types:
backend = instantiate_backend(be, array_type)
# GAK
gak_zeros = tslearn.metrics.gak(
s1=backend.zeros(405, dtype=backend.float64),
s2=backend.zeros(405, dtype=backend.float64),
sigma=1.0)
np.testing.assert_allclose(gak_zeros, desired=1, atol=1e-8)
g = tslearn.metrics.cdist_gak(
cast([[1, 2, 2, 3], [1.0, 2.0, 3.0, 4.0]], array_type), sigma=2.0, be=be
)
Expand Down
Loading