/** * BitNet 1-bit Quantized Classifier for Resource Types * * A small, purpose-built neural network using 1-bit weight quantization. * Classifies cloud resource type strings into verification categories. * * Architecture: * - Tokenizer: splits resource types on underscores * - Embedding: maps tokens to vectors * - 1-bit Linear layers: weights in {-1, 0, +1} * - Output: 13 category logits */ import type { VerificationCategory } from './categories.js'; import { type TrainingExample } from './training-data.js'; /** * BitNet classifier model */ export interface BitNetModel { vocabulary: Map; embeddings: number[][]; hiddenWeights: number[][]; hiddenBias: number[]; outputWeights: number[][]; outputBias: number[]; config: { embedDim: number; hiddenDim: number; maxTokens: number; }; } /** * Train the BitNet model */ export declare function trainBitNet(data: TrainingExample[], config: { embedDim: number; hiddenDim: number; maxTokens: number; epochs: number; learningRate: number; }): BitNetModel; /** * Evaluate model accuracy */ export declare function evaluateBitNet(model: BitNetModel, data: TrainingExample[]): { accuracy: number; perCategory: Record; }; /** * Classify a resource type using the trained model */ export declare function classifyWithBitNet(model: BitNetModel, resourceType: string): { category: VerificationCategory; confidence: number; allScores: Record; }; /** * Serialize model to JSON (for shipping with package) */ export declare function serializeModel(model: BitNetModel): string; /** * Deserialize model from JSON */ export declare function deserializeModel(json: string): BitNetModel; /** * Train and export a model using the built-in training data */ export declare function trainDefaultModel(): BitNetModel; /** * Get the pre-trained model (lazy load) */ export declare function getPretrainedModel(): BitNetModel; /** * Load pre-trained weights if available */ export declare function loadPretrainedWeights(json: string): void; //# sourceMappingURL=bitnet.d.ts.map