nystrom-ncut 0.0.11__tar.gz → 0.0.12__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. {nystrom_ncut-0.0.11/src/nystrom_ncut.egg-info → nystrom_ncut-0.0.12}/PKG-INFO +1 -1
  2. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/pyproject.toml +1 -1
  3. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut/nystrom/nystrom.py +3 -1
  4. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut/visualize_utils.py +2 -2
  5. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12/src/nystrom_ncut.egg-info}/PKG-INFO +1 -1
  6. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/LICENSE +0 -0
  7. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/MANIFEST.in +0 -0
  8. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/README.md +0 -0
  9. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/requirements.txt +0 -0
  10. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/setup.cfg +0 -0
  11. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/__init__.py +0 -0
  12. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut/__init__.py +0 -0
  13. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut/common.py +0 -0
  14. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut/nystrom/__init__.py +0 -0
  15. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut/nystrom/distance_realization.py +0 -0
  16. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut/nystrom/normalized_cut.py +0 -0
  17. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut/propagation_utils.py +0 -0
  18. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut.egg-info/SOURCES.txt +0 -0
  19. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut.egg-info/dependency_links.txt +0 -0
  20. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/src/nystrom_ncut.egg-info/top_level.txt +0 -0
  21. {nystrom_ncut-0.0.11 → nystrom_ncut-0.0.12}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: nystrom_ncut
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Normalized Cut and Nyström Approximation
5
5
  Author-email: Huzheng Yang <huze.yann@gmail.com>, Wentinn Liao <wentinn.liao@gmail.com>
6
6
  Project-URL: Documentation, https://github.com/JophiArcana/Nystrom-NCUT/
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "nystrom_ncut"
7
- version = "0.0.11"
7
+ version = "0.0.12"
8
8
  authors = [
9
9
  { name = "Huzheng Yang", email = "huze.yann@gmail.com" },
10
10
  { name = "Wentinn Liao", email = "wentinn.liao@gmail.com" },
@@ -276,5 +276,7 @@ def solve_eig(
276
276
  eigen_vector = eigen_vector[:, indices]
277
277
 
278
278
  # correct the random rotation (flipping sign) of eigenvectors
279
- eigen_vector = eigen_vector * torch.sum(eigen_vector, dim=0).sign()
279
+ sign = torch.sum(eigen_vector, dim=0).sign()
280
+ sign[sign == 0] = 1.0
281
+ eigen_vector = eigen_vector * sign
280
282
  return eigen_vector, eigen_value
@@ -195,8 +195,8 @@ def rgb_from_cosine_tsne_3d(
195
195
  )
196
196
  perplexity = num_sample // 2
197
197
 
198
- def cosine_to_rbf(X: torch.Tensor) -> torch.Tensor: # [B... x N x 3]
199
- dr = DistanceRealization(n_components=3, num_sample=20000, distance="cosine", eig_solver="lobpcg")
198
+ def cosine_to_rbf(X: torch.Tensor) -> torch.Tensor:
199
+ dr = DistanceRealization(n_components=3, num_sample=20000, distance="cosine", eig_solver="svd_lowrank")
200
200
  return dr.fit_transform(X)
201
201
 
202
202
  def rgb_from_cosine(X_3d: torch.Tensor, q: float) -> torch.Tensor:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: nystrom_ncut
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Normalized Cut and Nyström Approximation
5
5
  Author-email: Huzheng Yang <huze.yann@gmail.com>, Wentinn Liao <wentinn.liao@gmail.com>
6
6
  Project-URL: Documentation, https://github.com/JophiArcana/Nystrom-NCUT/
File without changes
File without changes
File without changes
File without changes