UNPKG

thoughtmcp

Version:

AI that thinks more like humans do - MCP server with human-like cognitive architecture for enhanced reasoning, memory, and self-monitoring

138 lines 4.02 kB
/** * Stochastic Neural Processing Implementation * * Implements biological-like neural variability and probabilistic processing: * - Gaussian noise addition to simulate neural variability * - Stochastic resonance for weak signal enhancement * - Probabilistic decision sampling mechanisms * - Temperature-controlled randomness */ import { ComponentStatus, IStochasticNeuralProcessor } from "../interfaces/cognitive.js"; export interface NeuralSignal { values: number[]; strength: number; timestamp: number; metadata?: Record<string, unknown>; } export interface EnhancedSignal { original: number[]; enhanced: number[]; noise_added: number[]; enhancement_factor: number; signal_to_noise_ratio: number; } export interface StochasticOutput { processed_signal: number[]; noise_level: number; enhancement_applied: boolean; sampling_temperature: number; processing_metadata: { original_strength: number; final_strength: number; noise_contribution: number; resonance_detected: boolean; }; } export interface ProbabilisticSample { value: number; probability: number; temperature: number; distribution_type: string; } /** * StochasticNeuralProcessor implements biological-like neural processing * with noise, variability, and probabilistic decision making */ export declare class StochasticNeuralProcessor implements IStochasticNeuralProcessor { private noise_level; private temperature; private resonance_threshold; private max_noise_level; private status; private rng; /** * Initialize the stochastic neural processor with configuration */ initialize(config: Record<string, unknown>): Promise<void>; /** * Main processing method - applies stochastic neural processing */ process(input: NeuralSignal): Promise<StochasticOutput>; /** * Add Gaussian noise to signal - simulates biological neural variability */ addNoise(signal: number[], noiseLevel: number): number[]; /** * Apply stochastic resonance - noise can enhance weak signal detection */ applyStochasticResonance(signal: number[], noiseLevel: number): number[]; /** * Sample from probability distribution - implements probabilistic decisions */ sampleFromDistribution(distribution: number[]): number; /** * Adjust temperature parameter for randomness control */ adjustTemperature(temperature: number): void; /** * Reset processor state */ reset(): void; /** * Get current component status */ getStatus(): ComponentStatus; /** * Generate Gaussian noise using Box-Muller transform */ private generateGaussianNoise; /** * Compute optimal noise level for stochastic resonance */ private computeOptimalNoise; /** * Apply threshold detection with noise enhancement */ private thresholdDetection; /** * Compute adaptive threshold based on signal characteristics */ private computeAdaptiveThreshold; /** * Detect if stochastic resonance occurred */ private detectResonance; /** * Compute signal strength (RMS) */ private computeSignalStrength; /** * Compute noise contribution to signal */ private computeNoiseContribution; /** * Apply temperature scaling to probability distribution */ private applyTemperatureScaling; /** * Apply probabilistic sampling to signal values */ private applySampling; /** * Set random number generator (for testing) */ setRandomNumberGenerator(rng: () => number): void; /** * Get current noise level */ getNoiseLevel(): number; /** * Get current temperature */ getTemperature(): number; /** * Set noise level with bounds checking */ setNoiseLevel(level: number): void; } //# sourceMappingURL=StochasticNeuralProcessor.d.ts.map