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
Copy file name to clipboardExpand all lines: cebra/data/helper.py
+14-9Lines changed: 14 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -94,10 +94,15 @@ class OrthogonalProcrustesAlignment:
94
94
95
95
For each dataset, the data and labels to align the data on is provided.
96
96
97
-
1. The ``top_k`` indexes of the labels to align (``label``) that are the closest to the labels of the reference dataset (``ref_label``) are selected and used to sample from the dataset to align (``data``).
98
-
2. ``data`` and ``ref_data`` (the reference dataset) are subsampled to the same number of samples ``subsample``.
99
-
3. The orthogonal mapping is computed, using :py:func:`scipy.linalg.orthogonal_procrustes`, on those subsampled datasets.
100
-
4. The resulting orthongonal matrix ``_transform`` can be used to map the original ``data`` to the ``ref_data``.
97
+
1. The ``top_k`` indexes of the labels to align (``label``) that are the closest to
98
+
the labels of the reference dataset (``ref_label``) are selected and used to sample
99
+
from the dataset to align (``data``).
100
+
2. ``data`` and ``ref_data`` (the reference dataset) are subsampled to the same number
101
+
of samples ``subsample``.
102
+
3. The orthogonal mapping is computed, using :py:func:`scipy.linalg.orthogonal_procrustes`,
103
+
on those subsampled datasets.
104
+
4. The resulting orthongonal matrix ``_transform`` can be used to map the original ``data``
105
+
to the ``ref_data``.
101
106
102
107
Note:
103
108
``data`` and ``ref_data`` can be of different sample size (axis 0) but **must** have the same number
@@ -181,14 +186,14 @@ def fit(
181
186
elifref_data.shape[0] ==data.shape[0] and (ref_labelisNoneor
182
187
labelisNone):
183
188
raiseValueError(
184
-
f"Missing labels: the data to align are the same shape but you provided only "
185
-
f"one of the sets of labels. Either provide both the reference and alignment "
186
-
f"labels or none.")
189
+
"Missing labels: the data to align are the same shape but you provided only "
190
+
"one of the sets of labels. Either provide both the reference and alignment "
191
+
"labels or none.")
187
192
else:
188
193
ifref_labelisNoneorlabelisNone:
189
194
raiseValueError(
190
-
f"Missing labels: the data to align are not the same shape, "
191
-
f"provide labels to align the data and reference data.")
195
+
"Missing labels: the data to align are not the same shape, "
196
+
"provide labels to align the data and reference data.")
Copy file name to clipboardExpand all lines: cebra/data/load.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -663,7 +663,8 @@ def load(
663
663
- if no key is provided, the first data structure found upon iteration of the collection will be loaded;
664
664
- if a key is provided, it needs to correspond to an existing item of the collection;
665
665
- if a key is provided, the data value accessed needs to be a data structure;
666
-
- the function loads data for only one data structure, even if the file contains more. The function can be called again with the corresponding key to get the other ones.
666
+
- the function loads data for only one data structure, even if the file contains more. The function can be
667
+
called again with the corresponding key to get the other ones.
667
668
668
669
Args:
669
670
file: The path to the given file to load, in a supported format.
0 commit comments