UNPKG

clustering-tfjs

Version:

High-performance TypeScript clustering algorithms (K-Means, Spectral, Agglomerative) with TensorFlow.js acceleration and scikit-learn compatibility

39 lines 1.05 kB
/** * TensorFlow.js backend manager * * Manages a singleton instance of TensorFlow.js with support for * multiple backends and environments. */ import type * as tfType from '@tensorflow/tfjs-core'; /** * Backend configuration options */ export interface BackendConfig { /** * Preferred backend to use. If not specified, will auto-detect. * Options: 'cpu', 'webgl', 'wasm', 'node', 'node-gpu' */ backend?: string; /** * Custom flags to pass to the backend */ flags?: Record<string, unknown>; } /** * Initialize the TensorFlow.js backend */ export declare function initializeBackend(config?: BackendConfig): Promise<typeof tfType>; /** * Get the current TensorFlow instance * @throws Error if not initialized */ export declare function getTensorFlow(): typeof tfType; /** * Check if TensorFlow is initialized */ export declare function isInitialized(): boolean; /** * Reset the backend (mainly for testing) */ export declare function resetBackend(): void; //# sourceMappingURL=tf-backend.d.ts.map