/** * @octomil/browser — Privacy filters * * Differential privacy (gradient clipping + noise injection) and * quantization for communication-efficient federated learning. */ import type { WeightMap } from "./types.js"; /** * Clip gradients by L2 norm. If the L2 norm of the flattened weight map * exceeds `maxNorm`, scale all values down proportionally. */ export declare function clipGradients(delta: WeightMap, maxNorm: number): WeightMap; /** * Add calibrated Gaussian noise for (epsilon, delta)-differential privacy. * * Noise std = sensitivity * sqrt(2 * ln(1.25/deltaDP)) / epsilon * * @param delta Weight deltas to perturb. * @param epsilon Privacy budget. * @param sensitivity L2 sensitivity (typically the clipping norm). * @param deltaDP DP delta parameter. */ export declare function addGaussianNoise(delta: WeightMap, epsilon: number, sensitivity: number, deltaDP: number): WeightMap; export interface QuantizedWeightMap { [key: string]: { data: Int8Array | Int16Array; scale: number; zeroPoint: number; }; } /** * Quantize weights to reduced precision (8 or 16 bit). * Uses min-max symmetric quantization. */ export declare function quantize(delta: WeightMap, bits?: 8 | 16): QuantizedWeightMap; /** * Dequantize back to Float32Array. */ export declare function dequantize(quantized: QuantizedWeightMap): WeightMap; //# sourceMappingURL=privacy.d.ts.map