@aleph-ai/tinyaleph 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/physics/lyapunov.js +24 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-ai/tinyaleph",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Prime-resonant semantic computing framework - hypercomplex algebra, oscillator dynamics, arithmetic topology, and entropy-minimizing reasoning",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
package/physics/lyapunov.js
CHANGED
|
@@ -98,7 +98,30 @@ function classifyStability(lyapunovExponent) {
|
|
|
98
98
|
return 'chaotic'; // Strong divergence
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Compute adaptive coupling strength based on coherence or Lyapunov exponent
|
|
103
|
+
* @param {number} coherenceOrBase - Coherence value (0-1) or base coupling strength
|
|
104
|
+
* @param {number} [baseStrengthOrLyapunov=0.3] - Base strength (for coherence mode) or Lyapunov exponent
|
|
105
|
+
* @param {number} [gain=0.5] - Gain factor for legacy mode
|
|
106
|
+
* @returns {number} Adapted coupling strength
|
|
107
|
+
*/
|
|
108
|
+
function adaptiveCoupling(coherenceOrBase, baseStrengthOrLyapunov = 0.3, gain = 0.5) {
|
|
109
|
+
// If first arg is between 0 and 1 and second is small, treat as coherence mode
|
|
110
|
+
// adaptiveCoupling(coherence, baseStrength?)
|
|
111
|
+
if (coherenceOrBase >= 0 && coherenceOrBase <= 1 &&
|
|
112
|
+
(baseStrengthOrLyapunov >= 0.05 && baseStrengthOrLyapunov <= 1)) {
|
|
113
|
+
const coherence = coherenceOrBase;
|
|
114
|
+
const baseStrength = baseStrengthOrLyapunov;
|
|
115
|
+
|
|
116
|
+
// High coherence = stronger coupling, low coherence = weaker coupling
|
|
117
|
+
// Scale coupling between 0.5x and 1.5x base strength based on coherence
|
|
118
|
+
return baseStrength * (0.5 + coherence);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Legacy mode: adaptiveCoupling(baseCoupling, lyapunovExponent, gain?)
|
|
122
|
+
const baseCoupling = coherenceOrBase;
|
|
123
|
+
const lyapunovExponent = baseStrengthOrLyapunov;
|
|
124
|
+
|
|
102
125
|
if (lyapunovExponent < -0.1) return baseCoupling * (1 + gain);
|
|
103
126
|
if (lyapunovExponent > 0.1) return baseCoupling * (1 - gain);
|
|
104
127
|
return baseCoupling;
|