You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
brief: Normalize the input data to be a list of covariance matrices with shape (D, N, N) where D is the lenght of the list and N is the number of variables in the system.
79
79
80
80
Parameters:
81
81
- X: A list of 2D numpy arrays or tensors of shape: 1. (T, N) where T is the number of samples if X are multivariate series. 2. a list of 2D covariance matrices with shape (N, N).
82
82
- covmat_precomputed: A boolean flag to indicate if the input data is a list of covariance matrices or multivariate series.
83
83
- T (optional): A list of integers indicating the number of samples for each multivariate series.
84
-
- use_cpu: A boolean flag to indicate if the computation should be done on the CPU.
84
+
- device: The device to use for the computation. Default is 'cpu'.
85
85
'''
86
86
87
-
# Get device to use
88
-
device=_get_device(use_cpu)
89
-
90
87
# Handle different options for X parameter. Accept multivariate data or covariance matrix
Brief: Greedy algorithm to find the best order of nplets to maximize the metric for a given multivariate series or covariance matrices
29
30
30
31
Parameters:
31
-
- X (Union[np.ndarray, torch.Tensor, List[np.ndarray], List[torch.Tensor]]): The input data to compute the nplets. It can be a list of 2D numpy arrays or tensors of shape: 1. (T, N) where T is the number of samples if X are multivariate series. 2. a list of 2D covariance matrices with shape (N, N).
32
-
- covmat_precomputed (bool): A boolean flag to indicate if the input data is a list of covariance matrices or multivariate series.
33
-
- T (Optional[Union[int, List[int]]]): A list of integers indicating the number of samples for each multivariate series.
32
+
- X (TensorLikeArray): The input data to compute the nplets. It can be a list of 2D numpy arrays or tensors of shape: 1. (T, N) where T is the number of samples if X are multivariate series. 2. a list of 2D covariance matrices with shape (N, N).
33
+
- initial_order (int): The initial order to start the greedy algorithm. Default is 3.
34
+
- order (Optional[int]): The final order to stop the greedy algorithm. If None, it will be set to N.
35
+
- covmat_precomputed (bool): A boolean flag to indicate if the input data is a list of covariance matrices or multivariate series.
36
+
- T (Optional[Union[int, List[int]]]): A list of integers indicating the number of samples for each multivariate series.
37
+
- repeat (int): The number of repetition to do to obtain different solutions starting from les optimal initial solutions.
38
+
- device (torch.device): The device to use for the computation. Default is 'cpu'.
39
+
- batch_size (int): The batch size to use for the computation. Default is 1000000.
40
+
- metric (Union[str,Callable]): The metric to evaluate. One of tc, dtc, o, s or a callable function
41
+
- largest (bool): A flag to indicate if the metric is to be maximized or minimized
42
+
43
+
Returns:
44
+
- best_nplets (torch.Tensor): The nplets with the best score found with shape (repeat, order)
45
+
- best_scores (torch.Tensor): The best scores for the best nplets with shape (repeat,)
34
46
'''
35
47
36
-
covmats, D, N, T, device=_normalize_input_data(X, covmat_precomputed, T, use_cpu)
48
+
covmats, D, N, T=_normalize_input_data(X, covmat_precomputed, T, device)
0 commit comments