MCPcopy
hub / github.com/stumpy-dev/stumpy / gpu_stump

Function gpu_stump

stumpy/gpu_stump.py:483–867  ·  view source on GitHub ↗

Compute the z-normalized matrix profile with one or more GPU devices This is a convenience wrapper around the Numba ``cuda.jit`` ``_gpu_stump`` function which computes the matrix profile according to GPU-STOMP. The default number of threads-per-block is set to ``512`` and may be ch

(
    T_A,
    m,
    T_B=None,
    ignore_trivial=True,
    device_id=0,
    normalize=True,
    p=2.0,
    k=1,
    T_A_subseq_isconstant=None,
    T_B_subseq_isconstant=None,
)

Source from the content-addressed store, hash-verified

481
482@core.non_normalized(gpu_aamp)
483def gpu_stump(
484 T_A,
485 m,
486 T_B=None,
487 ignore_trivial=True,
488 device_id=0,
489 normalize=True,
490 p=2.0,
491 k=1,
492 T_A_subseq_isconstant=None,
493 T_B_subseq_isconstant=None,
494):
495 """
496 Compute the z-normalized matrix profile with one or more GPU devices
497
498 This is a convenience wrapper around the Numba ``cuda.jit`` ``_gpu_stump`` function
499 which computes the matrix profile according to GPU-STOMP. The default number of
500 threads-per-block is set to ``512`` and may be changed by setting the global
501 parameter ``config.STUMPY_THREADS_PER_BLOCK`` to an appropriate number based on
502 your GPU hardware.
503
504 Parameters
505 ----------
506 T_A : numpy.ndarray
507 The time series or sequence for which to compute the matrix profile.
508
509 m : int
510 Window size.
511
512 T_B : numpy.ndarray, default None
513 The time series or sequence that will be used to annotate ``T_A``. For every
514 subsequence in ``T_A``, its nearest neighbor in ``T_B`` will be recorded.
515 Default is ``None`` which corresponds to a self-join.
516
517 ignore_trivial : bool, default True
518 Set to ``True`` if this is a self-join (i.e., for a single time series
519 ``T_A`` without ``T_B``). This ensures that an exclusion zone is applied
520 to each subsequence in ``T_A`` and all trivial/self-matches are ignored.
521 Otherwise, for an AB-join (i.e., between two times series, ``T_A`` and
522 ``T_B``), set this to ``False``.
523
524 device_id : int or list, default 0
525 The (GPU) device number to use. The default value is ``0``. A list of
526 valid device ids (``int``) may also be provided for parallel GPU-STUMP
527 computation. A list of all valid device ids can be obtained by
528 executing ``[device.id for device in numba.cuda.list_devices()]``.
529
530 normalize : bool, default True
531 When set to ``True``, this z-normalizes subsequences prior to computing
532 distances. Otherwise, this function gets re-routed to its complementary
533 non-normalized equivalent set in the ``@core.non_normalized`` function
534 decorator.
535
536 p : float, default 2.0
537 The p-norm to apply for computing the Minkowski distance. Minkowski distance is
538 typically used with ``p`` being ``1`` or ``2``, which correspond to the
539 Manhattan distance and the Euclidean distance, respectively. This parameter is
540 ignored when ``normalize == True``.

Calls 2

mparrayClass · 0.90
_gpu_stumpFunction · 0.85