Skip to content

Commit 0b25565

Browse files
Copilotfermga
andcommitted
Fix biomedical examples and update Silence docstring with clinical documentation links
Co-authored-by: fermga <203334638+fermga@users.noreply.github.com>
1 parent 024bda1 commit 0b25565

File tree

3 files changed

+68
-130
lines changed

3 files changed

+68
-130
lines changed

examples/biomedical/recovery_protocols_sha.py

Lines changed: 29 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,20 @@
33
This example demonstrates SHA (Silence) in athletic training as a recovery
44
mechanism that enables adaptation consolidation.
55
6-
Protocol: [Training] VAL → OZ → IL → [Recovery] SHA → [Next Session] NAV → AL
7-
- Training: Expansion + Dissonance + Coherence (stress and adaptation)
8-
- Recovery: Silence (νf → 0, adaptation consolidates)
9-
- Next training: Transition + Emission (return with improved baseline)
6+
Protocol: AL → VAL → OZ → IL → SHA
7+
- Emission: Training session begins
8+
- Expansion + Dissonance + Coherence: Stress and acute adaptation
9+
- SHA: Recovery pause (νf → 0, adaptation consolidates)
1010
1111
Key insight: SHA models the essential recovery phase where reduced activity
12-
allows physiological adaptations to consolidate - muscle repair, metabolic
13-
adjustments, and performance gains require structural pause.
12+
allows physiological adaptations to consolidate.
1413
1514
References:
1615
- Kellmann, M., et al. (2018). Recovery and Performance in Sport.
1716
- See: docs/source/examples/SHA_CLINICAL_APPLICATIONS.md, Section 4
1817
"""
1918

20-
from tnfr.operators.definitions import (
21-
Expansion,
22-
Dissonance,
23-
Coherence,
24-
Silence,
25-
Transition,
26-
Emission,
27-
)
19+
from tnfr.operators.definitions import Emission, Expansion, Dissonance, Coherence, Silence
2820
from tnfr.structural import create_nfr, run_sequence
2921

3022

@@ -39,79 +31,47 @@ def main():
3931
# Create muscle tissue node
4032
G, muscle = create_nfr("muscle_tissue", epi=0.50, vf=1.00)
4133

42-
# === TRAINING PHASE ===
34+
# === TRAINING + RECOVERY ===
4335
print("=" * 70)
44-
print("TRAINING PHASE - Controlled Stress Application")
36+
print("TRAINING → RECOVERY CYCLE")
4537
print("=" * 70)
4638
print()
4739

48-
print("Protocol: VAL → OZ → IL (Exercise sequence)")
40+
print("Protocol: AL → VAL → OZ → IL → SHA")
4941
print()
5042

51-
print("Step 1: EXPANSION (VAL) - Intense muscular activation")
43+
print("Step 1: EMISSION (AL) - Training session begins")
44+
print(" Athlete initiates workout, system activation")
45+
print()
46+
47+
print("Step 2: EXPANSION (VAL) - Intense muscular activation")
5248
print(" Activity: High-intensity intervals, heavy resistance")
5349
print(" Effect: Increased metabolic demand, fiber recruitment")
5450
print()
5551

56-
print("Step 2: DISSONANCE (OZ) - Metabolic stress")
52+
print("Step 3: DISSONANCE (OZ) - Metabolic stress")
5753
print(" Markers: Lactate, ROS, microdamage (adaptive stimulus)")
5854
print(" Signal: Triggers remodeling response")
5955
print()
6056

61-
print("Step 3: COHERENCE (IL) - Acute homeostatic response")
57+
print("Step 4: COHERENCE (IL) - Acute homeostatic response")
6258
print(" Process: Immediate compensation, metabolite clearance")
59+
print(" Training complete - adaptive stimulus applied")
6360
print()
6461

65-
run_sequence(G, muscle, [Expansion(), Dissonance(), Coherence()])
66-
67-
print("✓ Training complete - Adaptive stimulus applied")
68-
print(" Markers: Elevated HR, temperature, fatigue, glycogen depletion")
69-
print()
70-
71-
# === RECOVERY PHASE ===
72-
print("=" * 70)
73-
print("RECOVERY PHASE - SHA Adaptation Consolidation")
74-
print("=" * 70)
75-
print()
76-
77-
print("Step 4: SILENCE (SHA) - Recovery period")
78-
print(" Context: 48-72 hour recovery period")
62+
print("Step 5: SILENCE (SHA) - Recovery period [48-72 hours]")
7963
print(" Activities: Sleep, nutrition, light movement")
8064
print(" Effect: νf → 0 (minimal activity), adaptation emerges")
8165
print(" Process:")
8266
print(" • Day 1: Residual soreness, metabolite clearance")
8367
print(" • Day 2: Deep adaptation (protein synthesis peaks)")
84-
print(" • Result: EPI increases (structural improvement)")
68+
print(" • Result: Structural improvement for next training")
8569
print()
8670

87-
run_sequence(G, muscle, [Silence()])
71+
# Execute the complete sequence
72+
run_sequence(G, muscle, [Emission(), Expansion(), Dissonance(), Coherence(), Silence()])
8873

89-
print("✓ Recovery complete - Adaptation consolidated")
90-
print(" Changes: Muscle protein synthesis, glycogen supercompensation,")
91-
print(" mitochondrial biogenesis, neural efficiency")
92-
print()
93-
94-
# === NEXT TRAINING ===
95-
print("=" * 70)
96-
print("NEXT TRAINING SESSION - Adapted Baseline")
97-
print("=" * 70)
98-
print()
99-
100-
print("Protocol: NAV → AL (Return to training)")
101-
print()
102-
103-
print("Step 5: TRANSITION (NAV) - Recovery → Active")
104-
print(" Process: Return to normal training readiness")
105-
print()
106-
107-
print("Step 6: EMISSION (AL) - Next training begins")
108-
print(" Context: Training resumes with adapted system")
109-
print(" Expected: Improved baseline capacity")
110-
print()
111-
112-
run_sequence(G, muscle, [Transition(), Emission()])
113-
114-
print("✓ Ready for training - Performance capacity increased")
74+
print("✓ Recovery complete - Adaptation consolidated, ready for next training")
11575
print()
11676

11777
# Training applications
@@ -125,28 +85,20 @@ def main():
12585
print(" • Low frequency: SHA 72-96h+ (adaptation/taper)")
12686
print()
12787
print("Overtraining Prevention:")
128-
print(" ⚠ Warning: ΔNFR fails to normalize during SHA")
129-
print(" → Intervention: Extend SHA, reduce training load")
130-
print(" ✓ Recovery: νf normalizes, ΔNFR < 0.10")
131-
print()
132-
print("Performance Optimization:")
133-
print(" • SHA timing: Match recovery to adaptation timeline")
134-
print(" • SHA quality: Lower EPI variance = better recovery")
135-
print(" • Return criteria: Low ΔNFR + normalized νf")
88+
print(" ⚠ Warning: Inadequate SHA leads to accumulated stress")
89+
print(" ✓ Solution: Extend SHA, reduce training load")
13690

13791
# Physiological correlates
13892
print()
13993
print("=" * 70)
14094
print("PHYSIOLOGICAL CORRELATES")
14195
print("=" * 70)
14296
print()
143-
print("TNFR Metric → Physiological Marker → Measurement")
97+
print("TNFR Metric → Physiological Marker")
14498
print("-" * 70)
145-
print("SHA activation → Recovery mode → HRV, resting HR")
146-
print("νf reduction → Metabolic downreg → VO2, RMR")
147-
print("EPI growth → Structural adaptation → Muscle cross-section")
148-
print("ΔNFR normal → Stress clearance → Cortisol, CK, IL-6")
149-
print("SHA duration → Recovery time → Performance tests")
99+
print("SHA activation → Recovery mode (HRV, resting HR)")
100+
print("νf reduction → Metabolic downregulation (VO2, RMR)")
101+
print("EPI growth → Structural adaptation (performance gains)")
150102

151103
print()
152104
print("=" * 70)
@@ -155,9 +107,8 @@ def main():
155107
print("\nSHA enables training adaptation through:")
156108
print(" 1. Reduced activity (νf → 0) = metabolic downregulation")
157109
print(" 2. Structure evolution (EPI increases) = adaptation emerges")
158-
print(" 3. Pressure normalization (ΔNFR decreases) = recovery complete")
159110
print("\nWithout adequate SHA (recovery), training stress accumulates")
160-
print("without adaptation, leading to overtraining and performance decline.")
111+
print("without adaptation, leading to overtraining and decline.")
161112

162113
print("\n" + "=" * 70)
163114
print("PROTOCOL COMPLETE")

examples/biomedical/sleep_consolidation_sha.py

Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
This example demonstrates SHA (Silence) modeling sleep-dependent memory
44
consolidation, showing how structural pause enables learning retention.
55
6-
Protocol: [Day] AL → IL → SHA → [Night continues SHA] → [Next Day] NAV → AL
7-
- Day learning: Emission + Coherence (pattern acquisition)
8-
- Night sleep: Silence (νf → 0, EPI preserved - consolidation)
9-
- Next day: Transition + Emission (memory recall)
6+
Protocol: [Day] AL → IL → SHA
7+
- Day learning: Emission + Coherence (pattern acquisition + SHA consolidation)
8+
- Models sleep consolidation through structural pause
109
1110
Key insight: SHA models deep slow-wave sleep where neuronal firing decreases
1211
dramatically (νf → 0) while learned patterns (EPI) are preserved intact.
@@ -16,7 +15,7 @@
1615
- See: docs/source/examples/SHA_CLINICAL_APPLICATIONS.md, Section 3
1716
"""
1817

19-
from tnfr.operators.definitions import Emission, Coherence, Silence, Transition
18+
from tnfr.operators.definitions import Emission, Coherence, Silence
2019
from tnfr.structural import create_nfr, run_sequence
2120

2221

@@ -31,69 +30,37 @@ def main():
3130
# Create learning neuron node
3231
G, neuron = create_nfr("learning_neuron", epi=0.20, vf=1.20)
3332

34-
# === DAY: ACTIVE LEARNING ===
33+
# === DAY: LEARNING + SLEEP CONSOLIDATION ===
3534
print("=" * 70)
36-
print("DAY - ACTIVE LEARNING PHASE")
35+
print("LEARNING → SLEEP CONSOLIDATION CYCLE")
3736
print("=" * 70)
3837
print()
3938

40-
print("Protocol: AL → IL (Learning sequence)")
39+
print("Protocol: AL → IL → SHA")
4140
print()
4241

43-
print("Step 1: EMISSION (AL) - New information presented")
42+
print("Step 1: EMISSION (AL) - New information presented [DAY]")
4443
print(" Student encounters new concept, neural activation begins")
45-
print()
46-
47-
print("Step 2: COHERENCE (IL) - Pattern stabilizes")
4844
print(" Synaptic integration, early LTP formation")
49-
print(" Pattern begins to cohere, initial memory trace formed")
50-
print()
51-
52-
run_sequence(G, neuron, [Emission(), Coherence()])
53-
54-
print("✓ Learning complete - Pattern acquired")
5545
print()
5646

57-
# === NIGHT: SLEEP CONSOLIDATION ===
58-
print("=" * 70)
59-
print("NIGHT - SLEEP CONSOLIDATION (SHA)")
60-
print("=" * 70)
47+
print("Step 2: COHERENCE (IL) - Pattern stabilizes [DAY]")
48+
print(" Pattern coheres, initial memory trace formed")
49+
print(" Learning complete - ready for sleep consolidation")
6150
print()
6251

63-
print("Step 3: SILENCE (SHA) - Deep sleep structural pause")
52+
print("Step 3: SILENCE (SHA) - Sleep consolidation [NIGHT]")
6453
print(" Context: Deep slow-wave sleep (stages 3-4)")
65-
print(" Duration: 6-8 hours (typical sleep period)")
54+
print(" Duration: 6-8 hours")
6655
print(" Neural correlate: δ waves (0.5-4 Hz)")
67-
print(" Effect: νf → 0 (minimal firing), EPI preserved (pattern intact)")
56+
print(" Effect: νf → 0 (minimal firing), EPI preserved")
6857
print(" Process: Synaptic consolidation without interference")
6958
print()
7059

71-
run_sequence(G, neuron, [Silence()])
72-
73-
print("✓ Sleep consolidation complete - Memory preserved")
74-
print()
75-
76-
# === NEXT DAY: MEMORY RECALL ===
77-
print("=" * 70)
78-
print("NEXT DAY - MEMORY REACTIVATION")
79-
print("=" * 70)
80-
print()
81-
82-
print("Protocol: NAV → AL (Wake and recall)")
83-
print()
84-
85-
print("Step 4: TRANSITION (NAV) - Sleep → wake transition")
86-
print(" Process: Awakening, neuronal activity increases")
87-
print()
88-
89-
print("Step 5: EMISSION (AL) - Memory recall initiated")
90-
print(" Context: Student attempts to recall learned material")
91-
print(" Effect: Pattern retrieved with high fidelity")
92-
print()
93-
94-
run_sequence(G, neuron, [Transition(), Emission()])
60+
# Execute the complete sequence
61+
run_sequence(G, neuron, [Emission(), Coherence(), Silence()])
9562

96-
print("✓ Recall complete - Memory successfully retrieved")
63+
print("✓ Consolidation complete - Memory preserved through sleep")
9764
print()
9865

9966
# Neuroscientific correlates
@@ -106,7 +73,6 @@ def main():
10673
print("SHA activation → SWS onset → δ waves (0.5-4 Hz)")
10774
print("νf → 0 → Reduced firing → Single-unit recordings")
10875
print("EPI preservation → Synaptic maintain → LTP stability")
109-
print("ΔNFR inactive → Reduced interference → Memory stability tests")
11076
print("SHA duration → Sleep stage duration → Polysomnography")
11177

11278
# Research applications
@@ -132,7 +98,7 @@ def main():
13298
print("\nSHA models sleep's role in memory through:")
13399
print(" 1. Minimal reorganization (νf → 0) = reduced neural activity")
134100
print(" 2. Pattern preservation (EPI intact) = memory maintained")
135-
print(" 3. Interference prevention (ΔNFR inactive) = no disruption")
101+
print(" 3. Interference prevention = no disruption during consolidation")
136102
print("\nThis explains why sleep is essential for learning: structural")
137103
print("pause allows patterns to consolidate without interference.")
138104

src/tnfr/operators/definitions.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,6 +2194,27 @@ class Silence(Operator):
21942194
Coherence : Often precedes SHA for stable preservation
21952195
Transition : Breaks silence with controlled change
21962196
Emission : Reactivates silenced structures
2197+
2198+
Extended Clinical Documentation
2199+
--------------------------------
2200+
For detailed clinical protocols, expected telemetry, physiological correlates,
2201+
and scientific references, see:
2202+
2203+
**docs/source/examples/SHA_CLINICAL_APPLICATIONS.md**
2204+
2205+
Comprehensive documentation includes:
2206+
- Cardiac Coherence Training (HRV consolidation)
2207+
- Trauma Therapy (protective containment)
2208+
- Sleep & Memory Consolidation (neuroscience applications)
2209+
- Post-Exercise Recovery (athletic training)
2210+
- Meditation & Mindfulness (contemplative practices)
2211+
- Organizational Strategy (strategic pause protocols)
2212+
2213+
**Executable Examples**: examples/biomedical/
2214+
- cardiac_coherence_sha.py
2215+
- trauma_containment_sha.py
2216+
- sleep_consolidation_sha.py
2217+
- recovery_protocols_sha.py
21972218
"""
21982219

21992220
__slots__ = ()

0 commit comments

Comments
 (0)