-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.py
More file actions
103 lines (91 loc) Β· 5.03 KB
/
report.py
File metadata and controls
103 lines (91 loc) Β· 5.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env python3
"""BrainWire Full Project Report β one command, everything."""
import sys
def main():
print("""
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BrainWire v2.0 β Neural Interface Hardware for Consciousness β
β No molecules. No detection. No tolerance. Just electrons. β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
""")
# 1. Package status
from brainwire import __version__
from brainwire.variables import VAR_NAMES
from brainwire.profiles import list_profiles
from brainwire.hardware.configs import TIER_CONFIGS
print(f" Package: brainwire v{__version__}")
print(f" Variables: {len(VAR_NAMES)}, Profiles: {len(list_profiles())}, Tiers: {len(TIER_CONFIGS)}")
# 2. Joywire benchmark across tiers
print(f"\n βββ Joywire Performance by Tier βββ\n")
from brainwire.bench import run_benchmark
print(f" {'Tier':>6} {'Cost':>8} {'Avg%':>7} {'TM%':>7} {'β₯100%':>6}")
print(f" {'-'*6} {'-'*8} {'-'*7} {'-'*7} {'-'*6}")
for tier in sorted(TIER_CONFIGS.keys()):
r = run_benchmark('thc', tier)
print(f" {tier:>6} ${TIER_CONFIGS[tier]['cost']:>6,} {r['avg_match']:>6.1f}% "
f"{r['tension']['tension_match']:>6.1f}% {r['over_100_count']:>4}/12")
# 3. Optimized performance
print(f"\n βββ Optimized Tension Match (Tier 4) βββ\n")
from brainwire.optimizer import optimize_for_profile
print(f" {'State':>12} {'Generic TM':>10} {'Optimized':>10} {'Ξ':>8}")
print(f" {'-'*12} {'-'*10} {'-'*10} {'-'*8}")
from brainwire.engine.transfer import TransferEngine
from brainwire.engine.tension import compute_tension
engine = TransferEngine()
from brainwire.hardware.configs import get_tier_params
for state in sorted(list_profiles()):
from brainwire.profiles import load_profile
profile = load_profile(state)
gen = engine.compute(get_tier_params(4))
gen_tm = compute_tension(gen, target=profile.target)['tension_match']
opt = optimize_for_profile(state, 4, max_iters=30)
delta = opt['tension_match'] - gen_tm
print(f" {state:>12} {gen_tm:>9.1f}% {opt['tension_match']:>9.1f}% {delta:>+7.1f}%")
# 4. G=DΓP/I
print(f"\n βββ G=DΓP/I Golden Zone Analysis βββ\n")
from brainwire.eeg_feedback import g_targets_for_states, GOLDEN_ZONE
results = g_targets_for_states()
print(f" Golden Zone: [{GOLDEN_ZONE[0]:.4f}, {GOLDEN_ZONE[1]:.4f}]")
print(f"\n {'State':>12} {'G':>8} {'Zone':<8}")
print(f" {'-'*12} {'-'*8} {'-'*8}")
for name, g in sorted(results.items(), key=lambda x: x[1]['G']):
marker = ' <<<' if g['in_golden_zone'] else ''
print(f" {name:>12} {g['G']:>7.4f} {g['zone']:<6}{marker}")
# 5. PK peak sequence
print(f"\n βββ Pharmacokinetic Peak Sequence βββ\n")
from brainwire.pharmacokinetics import simulate_thc_pharmacokinetics
pk = simulate_thc_pharmacokinetics('strong', 7200, 10)
for var, peak_t in sorted(pk['peak_times'].items(), key=lambda x: x[1]):
tgt = pk['target'][var]
bar = 'β' * int(peak_t / 60)
print(f" {var:<12} {peak_t/60:>5.1f}m {bar}")
# 6. Key discoveries
print(f"\n βββ Key Discoveries βββ\n")
discoveries = [
("State A = max entropy", "3.431 bits (1st of 6)"),
("State A = ONLY golden zone", "G=0.4731"),
("Tension = intensity", "Kendall tau = 1.000"),
("State D = 1.51Γ State L", "direction sim 98.7%"),
("State M = centroid", "lowest variance to all states"),
("Flow = min tension", "T=2.985 (closest to baseline)"),
("$145 covers 12/12 vars", "tDCS + entrainment + taVNS"),
("GVS = best DA/dollar", "$50 for 0.30Γ DA"),
("tRNS > tDCS for Sensory", "stochastic resonance"),
("6 electrode groups optimal", "Perfect Number Ο(6)=12"),
]
for title, value in discoveries:
print(f" β’ {title:<30} {value}")
# 7. Minimum hardware
print(f"\n βββ Minimum Hardware βββ\n")
print(f" $30 tDCS β 8/12 vars (DA,eCB,5HT,GABA,Alpha,PFC,Sensory,Body)")
print(f" $15 LED+audio+vib β 3/12 vars (Gamma,Theta,Coherence)")
print(f" $100 taVNS β 1/12 vars (NE)")
print(f" ββββ ββββββββββββββ βββββββββ")
print(f" $145 TOTAL 12/12 vars covered")
print(f"\n{'='*70}")
print(f" 145 tests | 75 hypotheses (97.3%) | $85 to start | $2.5K headband")
print(f" Math done. Hardware designed. Build guide ready. Experiment protocol ready.")
print(f" Next: $85 β build β wear β feel.")
print(f"{'='*70}\n")
if __name__ == '__main__':
main()