nystrom-ncut 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,7 +44,7 @@ def distance_from_features(
44
44
  c = 2.0
45
45
  p = torch.erf(torch.tensor((-c, c), device=features.device) * (2 ** -0.5))
46
46
  stds = torch.quantile(features, q=(p + 1) / 2, dim=0)
47
- stds = (stds[1] - stds[0]) / 2
47
+ stds = (stds[1] - stds[0]) / (2 * c)
48
48
  D = D / (2 * torch.linalg.norm(stds) ** 2)
49
49
  else:
50
50
  raise ValueError("distance should be 'cosine' or 'euclidean', 'rbf'")
@@ -82,4 +82,7 @@ def fpsample(
82
82
  U, S, V = torch.pca_lowrank(features, q=config.fps_dim)
83
83
  features = U * S
84
84
 
85
- return sample_farthest_points(features[None], K=config.num_sample)[1][0]
85
+ try:
86
+ return sample_farthest_points(features[None], K=config.num_sample)[1][0]
87
+ except RuntimeError:
88
+ return sample_farthest_points(features[None].cpu(), K=config.num_sample)[1][0].to(features.device)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: nystrom_ncut
3
- Version: 0.1.3
3
+ Version: 0.1.4
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/
@@ -1,15 +1,15 @@
1
1
  __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  nystrom_ncut/__init__.py,sha256=HifrTcqX2-hYjBDe6xIThHvuIBYMPBA3EzjR8-qPMUM,512
3
3
  nystrom_ncut/common.py,sha256=_PGJoImSk_Fb_5Ri-e_IsFoCcSfbGS8CxYUUHVoNM50,2036
4
- nystrom_ncut/distance_utils.py,sha256=xSMKL-sFGrz0EL106vhVx0qSk3iSdSLRFhGL0KmAOnU,3121
5
- nystrom_ncut/sampling_utils.py,sha256=7zCneqmkaA_fUkaZcykFjHtn7pxdZdsjAbKxJplegc0,2960
4
+ nystrom_ncut/distance_utils.py,sha256=wEXyKxkLv9VvF5xn42ypiwUAAq9xTh3RmMvdHhFuPms,3127
5
+ nystrom_ncut/sampling_utils.py,sha256=oMmhFcd_N_D15Ht7F0rCGPSgLeitJszAKMD3ICKwHNU,3105
6
6
  nystrom_ncut/visualize_utils.py,sha256=RsQVjPhxoIdxDOQ2PI7ifFDuEL23YXpZBdJ0wjjafek,22970
7
7
  nystrom_ncut/nystrom/__init__.py,sha256=4EpxD3Cmc8Fif4vo8DG-6FpTfCnNanD5zCZxK3WrMwQ,121
8
8
  nystrom_ncut/nystrom/distance_realization.py,sha256=9GX_XSISTvsEWUu8bG5AxtlkYYNItFspcH5wXiwSOKY,5789
9
9
  nystrom_ncut/nystrom/normalized_cut.py,sha256=ZxFV8Sckp6wtpNyoA15DS7Vfu9QLvzNpwrwY0n9_GNs,6953
10
10
  nystrom_ncut/nystrom/nystrom_utils.py,sha256=Wq364xlxBhr74lqyCkPWLBxq5YSt2zr-DSfYUHpYfgE,12989
11
- nystrom_ncut-0.1.3.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
12
- nystrom_ncut-0.1.3.dist-info/METADATA,sha256=tK9gbt1b0c5mGNm2e0OdAKQm7rFUWCuhn9myh_Vf408,6058
13
- nystrom_ncut-0.1.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
- nystrom_ncut-0.1.3.dist-info/top_level.txt,sha256=gM8IWWHYysIRTCvCTcdS4RShOyl9pxpylgSwPUZR2XM,22
15
- nystrom_ncut-0.1.3.dist-info/RECORD,,
11
+ nystrom_ncut-0.1.4.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
12
+ nystrom_ncut-0.1.4.dist-info/METADATA,sha256=lVURVQRK6krrpu6iUvDdX0-I5FD7mHFIK_uQjzHlxhU,6058
13
+ nystrom_ncut-0.1.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
+ nystrom_ncut-0.1.4.dist-info/top_level.txt,sha256=gM8IWWHYysIRTCvCTcdS4RShOyl9pxpylgSwPUZR2XM,22
15
+ nystrom_ncut-0.1.4.dist-info/RECORD,,