clustering-tfjs
Version:
High-performance TypeScript clustering algorithms (K-Means, Spectral, Agglomerative) with TensorFlow.js acceleration and scikit-learn compatibility
28 lines • 1.01 kB
TypeScript
import * as tf from '../tf-adapter';
/**
* Improved Jacobi eigendecomposition for symmetric matrices.
*
* Enhancements over the basic Jacobi method:
* 1. Cyclic Jacobi - systematically sweep through all pairs
* 2. Threshold scaling - adapt threshold as we converge
* 3. Better handling of small pivots
* 4. Post-processing to ensure non-negative eigenvalues for PSD matrices
*/
export declare function improved_jacobi_eigen(matrix: tf.Tensor2D, { maxIterations, tolerance, isPSD, }?: {
maxIterations?: number;
tolerance?: number;
isPSD?: boolean;
}): {
eigenvalues: number[];
eigenvectors: number[][];
};
/**
* Specialized version for normalized Laplacians.
* Takes advantage of the known properties:
* - Symmetric
* - Positive semi-definite
* - Eigenvalues in [0, 2]
* - Smallest eigenvalue(s) ≈ 0 for connected components
*/
export declare function laplacian_eigen_decomposition(laplacian: tf.Tensor2D, k: number): tf.Tensor2D;
//# sourceMappingURL=eigen_improved.d.ts.map