star-ga commited on
Commit
2dcc344
·
verified ·
1 Parent(s): 3da4f30

add architecture.mmd (architecture diagram + Mermaid source)

Browse files
Files changed (1) hide show
  1. architecture.mmd +21 -0
architecture.mmd ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ flowchart TB
2
+ INPUT["Input<br/>(drug_a, drug_b)<br/>e.g. warfarin + ibuprofen"]
3
+ ENCODE["encode_pair → 193-dim ternary feature vector<br/>• 64 BLAKE2b-128 hash trits per drug (×2 = 128 bits)<br/>• 26 ATC pharmacology flag bits per drug (×2 = 52 bits)<br/>• 13 pair-derived DDI rule bits"]
4
+ A["A Bundle (gate, 256-hidden)<br/>193 → 256 → 5<br/>ternary weights, Q16.16 biases<br/>bundle_id: 1f0f8859...<br/>50,949 params, 118 KB<br/>100% recall: contra (44/44), major (4/4)<br/>0 contra FP, 0 major FP"]
5
+ B["B Bundle (tier-2 specialist, 64-hidden)<br/>193 → 64 → 5<br/>ternary weights, Q16.16 biases<br/>bundle_id: 5f7ed5f6...<br/>~12,300 params, 30 KB<br/>trained on non-contra subset (95 samples)<br/>100% recall: serious (69/69), moderate (22/22)"]
6
+ DISPATCH["Cascade Dispatcher<br/>if A predicts contraindicated → contraindicated<br/>else → B's constrained argmax over moderate / serious / major<br/>composite weights_id = a_id + b_id (129 chars)"]
7
+ OUT["BitNetResult<br/>severity_name ∈ {none, moderate, serious, major, contraindicated}<br/>logits_q16: 5× Q16.16 fixed-point logits<br/>feature_hash: SHA-256 over 193-dim feature vector<br/>repro_hash: SHA-256 over feature_hash + logits + severity + weights_id<br/>weights_id: composite a_id + b_id<br/>= bit-identical replay primitive, verifiable on any chip, decades later"]
8
+
9
+ INPUT --> ENCODE
10
+ ENCODE --> A
11
+ ENCODE --> B
12
+ A --> DISPATCH
13
+ B --> DISPATCH
14
+ DISPATCH --> OUT
15
+
16
+ style INPUT fill:#EFF6FF,stroke:#2563eb,color:#1e3a8a,stroke-width:2px
17
+ style ENCODE fill:#F0FDFA,stroke:#0F766E,color:#134E4A,stroke-width:2px
18
+ style A fill:#FEF2F2,stroke:#dc2626,color:#7f1d1d,stroke-width:2px
19
+ style B fill:#EFF6FF,stroke:#2563eb,color:#1e3a8a,stroke-width:2px
20
+ style DISPATCH fill:#FEF3C7,stroke:#d97706,color:#7c2d12,stroke-width:2px
21
+ style OUT fill:#F0FDF4,stroke:#16a34a,color:#14532d,stroke-width:2px