Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 8 additions & 4 deletions deeplabcut/refine_training_dataset/stitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,14 @@ def estimate_rank(self, tol):
The optimal hard threshold for singular values is 4/sqrt(3)
"""
mat = self.to_hankelet()
# nrows, ncols = mat.shape
# beta = nrows / ncols
# omega = 0.56 * beta ** 3 - 0.95 * beta ** 2 + 1.82 * beta + 1.43
_, s, _ = sli.svd(mat, min(10, min(mat.shape)))
if np.any(mat): # check that the matrix contains non-zero entries
# nrows, ncols = mat.shape
# beta = nrows / ncols
# omega = 0.56 * beta ** 3 - 0.95 * beta ** 2 + 1.82 * beta + 1.43
_, s, _ = sli.svd(mat, min(10, min(mat.shape)))
else:
s = np.zeros(min(10, min(mat.shape)))

# return np.argmin(s > omega * np.median(s))
eigen = s**2
diff = np.abs(np.diff(eigen / eigen[0]))
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ imgaug>=0.4.0
numba>=0.54.0
matplotlib>=3.3, <3.8.4
networkx>=2.6
numpy>=1.18.5
numpy>=1.18.5,<2.0.0
pandas>=1.0.1,!=1.5.0
Pillow>=7.1
pyyaml
scikit-image>=0.17
scikit-learn>=1.0
scipy>=1.4,<1.11.0
scipy>=1.9
statsmodels>=0.11
tensorflow>=2.0,<2.13.0
tables==3.8.0
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def pytorch_config_paths() -> list[str]:
"numba>=0.54",
"matplotlib>=3.3,<3.9,!=3.7.0,!=3.7.1",
"networkx>=2.6",
"numpy>=1.18.5",
"numpy>=1.18.5,<2.0.0",
"pandas>=1.0.1,!=1.5.0",
"scikit-image>=0.17",
"scikit-learn>=1.0",
"scipy>=1.4,<1.11.0",
"scipy>=1.9",
"statsmodels>=0.11",
"tables==3.8.0",
"timm",
Expand Down