@dataelvisliang/embedding-atlas 0.15.0-highlight.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.
package/dist/umap.d.ts ADDED
@@ -0,0 +1,96 @@
1
+ export declare function createKNN(count: number, inputDim: number, data: Float32Array, options?: KNNOptions): Promise<KNN>;
2
+
3
+ /**
4
+ * Initialize a UMAP instance.
5
+ * @param count the number of data points
6
+ * @param inputDim the input dimension
7
+ * @param outputDim the output dimension
8
+ * @param data the data array. Must be a Float32Array with count * inputDim elements.
9
+ * @param options options
10
+ */
11
+ export declare function createUMAP(
12
+ count: number,
13
+ inputDim: number,
14
+ outputDim: number,
15
+ data: Float32Array,
16
+ options?: UMAPOptions,
17
+ ): Promise<UMAP>;
18
+
19
+ export declare interface KNN {
20
+ queryByIndex(index: number, k: number): KNNQueryResult;
21
+ queryByVector(data: Float32Array, k: number): KNNQueryResult;
22
+ destroy(): void;
23
+ }
24
+
25
+ /** KNN options */
26
+ export declare interface KNNOptions {
27
+ /** The distance metric */
28
+ metric?: "euclidean" | "cosine";
29
+
30
+ /** The nearest neighbor method. By default we use HNSW with its default parameters. */
31
+ method?: "hnsw" | "nndescent" | "vptree";
32
+ }
33
+
34
+ export declare interface KNNQueryResult {
35
+ indices: Int32Array;
36
+ distances: Float32Array;
37
+ }
38
+
39
+ export declare interface UMAP {
40
+ /** The current epoch number */
41
+ get epoch(): number;
42
+
43
+ /** The input dimension */
44
+ get inputDim(): number;
45
+
46
+ /** The output dimension */
47
+ get outputDim(): number;
48
+
49
+ /**
50
+ * Get the current embedding.
51
+ * The resulting Float32Array points to WASM internal memory.
52
+ * If you need to use the data outside this library or after further
53
+ * interaction with this library, make sure to create a copy
54
+ * of the array, as the underlying memory may change.
55
+ */
56
+ get embedding(): Float32Array;
57
+
58
+ /**
59
+ * Run the UMAP algorithm until reaching `epochLimit` epochs,
60
+ * or to completion if `epochLimit` is not specified.
61
+ * @param epochLimit the epoch number to run to
62
+ */
63
+ run(epochLimit?: number): void;
64
+
65
+ /** Destroy the instance and release resources */
66
+ destroy(): void;
67
+ }
68
+
69
+ /** UMAP options */
70
+ export declare interface UMAPOptions {
71
+ /** The input distance metric */
72
+ metric?: "euclidean" | "cosine";
73
+
74
+ /** The nearest neighbor method. By default we use HNSW with its default parameters. */
75
+ knnMethod?: "hnsw" | "nndescent" | "vptree";
76
+
77
+ /** The initialization method. By default we use spectral initialization. */
78
+ initializeMethod?: "spectral" | "random" | "none";
79
+
80
+ localConnectivity?: number;
81
+ bandwidth?: number;
82
+ mixRatio?: number;
83
+ spread?: number;
84
+ minDist?: number;
85
+ a?: number;
86
+ b?: number;
87
+ repulsionStrength?: number;
88
+ nEpochs?: number;
89
+ learningRate?: number;
90
+ negativeSampleRate?: number;
91
+ nNeighbors?: number;
92
+ /** The random seed. */
93
+ seed?: number;
94
+ }
95
+
96
+ export { }