umappp 0.1.6 → 0.2.1
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.
- checksums.yaml +4 -4
- data/README.md +22 -16
- data/ext/umappp/numo.hpp +957 -833
- data/ext/umappp/umappp.cpp +39 -45
- data/lib/umappp/version.rb +1 -1
- data/lib/umappp.rb +5 -4
- data/vendor/aarand/aarand.hpp +141 -28
- data/vendor/annoy/annoylib.h +1 -1
- data/vendor/hnswlib/bruteforce.h +142 -127
- data/vendor/hnswlib/hnswalg.h +1018 -939
- data/vendor/hnswlib/hnswlib.h +149 -58
- data/vendor/hnswlib/space_ip.h +322 -229
- data/vendor/hnswlib/space_l2.h +283 -240
- data/vendor/hnswlib/visited_list_pool.h +54 -55
- data/vendor/irlba/irlba.hpp +12 -27
- data/vendor/irlba/lanczos.hpp +30 -31
- data/vendor/irlba/parallel.hpp +37 -38
- data/vendor/irlba/utils.hpp +12 -23
- data/vendor/irlba/wrappers.hpp +239 -70
- data/vendor/kmeans/Details.hpp +1 -1
- data/vendor/kmeans/HartiganWong.hpp +28 -2
- data/vendor/kmeans/InitializeKmeansPP.hpp +29 -1
- data/vendor/kmeans/Kmeans.hpp +25 -2
- data/vendor/kmeans/Lloyd.hpp +29 -2
- data/vendor/kmeans/MiniBatch.hpp +48 -8
- data/vendor/knncolle/Annoy/Annoy.hpp +3 -0
- data/vendor/knncolle/Hnsw/Hnsw.hpp +3 -0
- data/vendor/knncolle/Kmknn/Kmknn.hpp +11 -1
- data/vendor/knncolle/utils/find_nearest_neighbors.hpp +8 -6
- data/vendor/umappp/Umap.hpp +85 -43
- data/vendor/umappp/optimize_layout.hpp +410 -133
- data/vendor/umappp/spectral_init.hpp +4 -1
- metadata +7 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88fcf9fcf8f61232a094afbf62a7aa421c564e644a854bd2efc1ba94dd1ab02
|
4
|
+
data.tar.gz: a92531b8da81479a4844ec5f5073423eefdf3fb9d32bed6f7cbe867771116087
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c56ce6be1fe5d9f296b512121be5e94cd844d2ea76ec75ad8e3224ace4023a45146da5cfe4fa779d557c99afbce85a22b951cd2b21a8b1f4f151c5911b13d12a
|
7
|
+
data.tar.gz: 21be7903f3aa0f03c0a60bf011415f115501e6741a94791465a6e25789ed2c411aed87042b11eeb15aa8ac43d39dff9000a30a7c79cdd0de1b310bd7f5b30044
|
data/README.md
CHANGED
@@ -7,12 +7,12 @@
|
|
7
7
|
|
8
8
|

|
9
9
|
|
10
|
-
> Uniform Manifold Approximation and Projection (UMAP) is a dimension reduction technique that can be used for visualisation similarly to t-SNE, but also for general non-linear dimension reduction.
|
10
|
+
> Uniform Manifold Approximation and Projection (UMAP) is a dimension reduction technique that can be used for visualisation similarly to t-SNE, but also for general non-linear dimension reduction.
|
11
11
|
> ([original UMAP documentation](https://umap-learn.readthedocs.io/en/latest/index.html))
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
- Ruby Umappp is a wrapper library for [C++ Umappp library](https://github.com/LTLA/umappp) created by Aaron Lun
|
14
|
+
- Compatible with [yaumap](https://github.com/LTLA/yaumap)
|
15
|
+
- Support [Numo::NArray](https://github.com/ruby-numo/numo-narray)
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
gem install umappp
|
21
21
|
```
|
22
22
|
|
23
|
-
|
23
|
+
- [OpenMP](https://www.openmp.org) is required for multithreading.
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
@@ -38,10 +38,9 @@ r = Umappp.run(pixels, num_threads: 8, a: 1.8956, b: 0.8006)
|
|
38
38
|
Available parameters and their default values
|
39
39
|
|
40
40
|
| parameters | default value |
|
41
|
-
|
41
|
+
| -------------------- | ---------------------------------- |
|
42
42
|
| method | :annoy (another option is :vptree) |
|
43
43
|
| ndim | 2 |
|
44
|
-
| tick | 0 (Not yet implemented) |
|
45
44
|
| local_connectivity | 1.0 |
|
46
45
|
| bandwidth | 1 |
|
47
46
|
| mix_ratio | 1 |
|
@@ -50,12 +49,12 @@ Available parameters and their default values
|
|
50
49
|
| a | 0 |
|
51
50
|
| b | 0 |
|
52
51
|
| repulsion_strength | 1 |
|
52
|
+
| initialize | Umappp::InitMethod::SPECTRAL |
|
53
53
|
| num_epochs | 500 |
|
54
54
|
| learning_rate | 1 |
|
55
55
|
| negative_sample_rate | 5 |
|
56
56
|
| num_neighbors | 15 |
|
57
57
|
| seed | 1234567890 |
|
58
|
-
| batch | false |
|
59
58
|
| num_threads | 1 (OpenMP required) |
|
60
59
|
|
61
60
|
## Development
|
@@ -63,20 +62,28 @@ Available parameters and their default values
|
|
63
62
|
```
|
64
63
|
git clone https://github.com/kojix2/ruby-umappp
|
65
64
|
cd umap
|
66
|
-
|
65
|
+
bundle exec rake compile
|
67
66
|
bundle exec rake test
|
68
67
|
```
|
69
68
|
|
69
|
+
Update LTLA/umappp
|
70
|
+
|
71
|
+
Requires cmake to run
|
72
|
+
|
73
|
+
```
|
74
|
+
cd script
|
75
|
+
./vendor.sh
|
76
|
+
```
|
77
|
+
|
70
78
|
### Ruby dependencies
|
71
79
|
|
72
|
-
|
73
|
-
|
80
|
+
- [rice](https://github.com/jasonroelofs/rice) - Ruby Interface for C++ Extensions
|
81
|
+
- [numo.hpp](https://github.com/ankane/numo.hpp) - C++ header for Numo and Rice
|
74
82
|
|
75
83
|
### Umappp dependencies
|
76
84
|
|
77
85
|
This Gem is a wrapper for [Umappp](https://github.com/LTLA/umappp). We store and distribute Umappp and other dependent C++ code in the Vendor directory. Umappp is compiled when the Gem is installed. Umappp's C++ modules have complex dependencies as shown in the figure below. It is not a good idea to manage them manually. Use `script/vendor.sh` to update them automatically. This actually runs cmake and moves the required directories to the vendor directory.
|
78
86
|
|
79
|
-
|
80
87
|
```mermaid
|
81
88
|
graph TD;
|
82
89
|
id1(eigen)-->CppIrlba;
|
@@ -105,7 +112,6 @@ Welcome!
|
|
105
112
|
|
106
113
|
## License
|
107
114
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
115
|
+
- As for the code I wrote, it is BSD 2-Clause (or MIT).
|
116
|
+
- The license of Umappp for C++ by Aaron Lun is BSD 2-Clause.
|
117
|
+
- For other codes, please check on your own. (There are many dependencies)
|