star-ga commited on
Commit
b7f0708
Β·
verified Β·
1 Parent(s): ffc42a3

Upload architecture.mmd with huggingface_hub

Browse files
Files changed (1) hide show
  1. architecture.mmd +21 -15
architecture.mmd CHANGED
@@ -1,21 +1,27 @@
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
 
 
 
 
 
 
 
1
+ flowchart LR
2
+ INPUT(["drug_a + drug_b"])
3
+ ENCODE["encode_pair<br/>193 trits"]
4
+ A["<b>A bundle</b><br/>193 β†’ 256 β†’ 5<br/>gate"]
5
+ B["<b>B bundle</b><br/>193 β†’ 64 β†’ 5<br/>specialist"]
6
+ DISPATCH{{"cascade<br/>dispatch"}}
7
+ OUT(["BitNetResult<br/>+ repro_hash"])
8
 
9
  INPUT --> ENCODE
10
  ENCODE --> A
11
  ENCODE --> B
12
+ A -->|"if contra"| DISPATCH
13
+ B -->|"else argmax"| DISPATCH
14
  DISPATCH --> OUT
15
 
16
+ classDef io fill:#EFF6FF,stroke:#2563eb,color:#1e3a8a,stroke-width:2px
17
+ classDef enc fill:#F0FDFA,stroke:#0F766E,color:#134E4A,stroke-width:2px
18
+ classDef bundleA fill:#FEF2F2,stroke:#dc2626,color:#7f1d1d,stroke-width:2px
19
+ classDef bundleB fill:#EFF6FF,stroke:#2563eb,color:#1e3a8a,stroke-width:2px
20
+ classDef disp fill:#FEF3C7,stroke:#d97706,color:#7c2d12,stroke-width:2px
21
+ classDef result fill:#F0FDF4,stroke:#16a34a,color:#14532d,stroke-width:2px
22
+
23
+ class INPUT,OUT io
24
+ class ENCODE enc
25
+ class A bundleA
26
+ class B bundleB
27
+ class DISPATCH disp