FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
stumpy/stumpy/gpu_aampdist.py at main · stumpy-dev/stumpy · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
stumpy-dev
/
stumpy
Public
Notifications
You must be signed in to change notification settings
Fork
367
Star
4.1k
Code
Issues
67
Pull requests
12
Discussions
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
stumpy
/
stumpy
/
gpu_aampdist.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
67 lines (52 loc) · 2.55 KB
Breadcrumbs
stumpy
/
stumpy
/
gpu_aampdist.py
Copy path
File metadata and controls
67 lines (52 loc) · 2.55 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import
functools
from
.
core
import
_mpdist
from
.
gpu_aamp
import
gpu_aamp
def
gpu_aampdist
(
T_A
,
T_B
,
m
,
percentage
=
0.05
,
k
=
None
,
device_id
=
0
,
p
=
2.0
):
"""
Compute the non-normalized (i.e., without z-normalization) matrix profile distance
(MPdist) measure between any two time series with one or more GPU devices and
`stumpy.gpu_aamp`.
The MPdist distance measure considers two time series to be similar if they share
many subsequences, regardless of the order of matching subsequences. MPdist
concatenates and sorts the output of an AB-join and a BA-join and returns the value
of the `k`th smallest number as the reported distance. Note that MPdist is a
measure and not a metric. Therefore, it does not obey the triangular inequality but
the method is highly scalable.
Parameters
----------
T_A : numpy.ndarray
The first time series or sequence for which to compute the matrix profile
T_B : numpy.ndarray
The second time series or sequence for which to compute the matrix profile
m : int
Window size
percentage : float, default 0.05
The percentage of distances that will be used to report `mpdist`. The value
is between 0.0 and 1.0. This parameter is ignored when `k` is not `None`.
k : int, default None
Specify the `k`th value in the concatenated matrix profiles to return. When `k`
is not `None`, then the `percentage` parameter is ignored.
device_id : int or list, default 0
The (GPU) device number to use. The default value is `0`. A list of
valid device ids (int) may also be provided for parallel GPU-STUMP
computation. A list of all valid device ids can be obtained by
executing `[device.id for device in numba.cuda.list_devices()]`.
p : float, default 2.0
The p-norm to apply for computing the Minkowski distance. Minkowski distance is
typically used with `p` being 1 or 2, which correspond to the Manhattan distance
and the Euclidean distance, respectively.
Returns
-------
MPdist : float
The matrix profile distance
Notes
-----
`DOI: 10.1109/ICDM.2018.00119
\
<https://www.cs.ucr.edu/~eamonn/MPdist_Expanded.pdf>`__
See Section III
"""
partial_mp_func
=
functools
.
partial
(
gpu_aamp
,
p
=
p
)
return
_mpdist
(
T_A
,
T_B
,
m
,
partial_mp_func
,
percentage
,
k
,
device_id
=
device_id
)
Back
|
FazBrowse Home
|
New Git URL