You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`spec.md` is the authoritative specification. All algorithm implementations must match the pseudocode and equations defined there.
113
131
132
+
## Web Demo
133
+
134
+
The `web-demo/` directory contains a fully interactive browser-based demo. The WASM crate (`web-demo/crate/`) is a pure-Rust reimplementation of the core AttnRes algorithm (no burn dependency for WASM portability), faithfully mirroring `src/attn_res_op.rs`. It exposes:
135
+
136
+
-`AttnResEngine` — model creation, forward pass, training simulation
137
+
-`compute_attn_res()` — interactive core operation with custom pseudo-queries
138
+
-`train_step()` — simulated training showing depth attention pattern emergence
139
+
140
+
Frontend: Vite + TypeScript with Canvas 2D visualizations (heatmaps, bar charts, loss curves). Academic design with full algorithm explanation.
141
+
114
142
## Known Gaps
115
143
116
144
- No PyTorch checkpoint loading (safetensors format)
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,19 @@ AttnResTransformer
63
63
64
64
**Note on `num_layers`**: This parameter counts *sublayers* (each transformer layer = 2 sublayers: attention + MLP). So `num_layers=8` means 4 transformer layers.
65
65
66
+
## Web Demo
67
+
68
+
An interactive browser-based demo runs the core AttnRes algorithm via Rust compiled to WASM:
69
+
70
+
```bash
71
+
cd web-demo
72
+
npm install
73
+
npm run build:wasm # Compile Rust → WASM (requires wasm-pack)
74
+
npm run dev # Start dev server at localhost:5173
75
+
```
76
+
77
+
Features: configurable model parameters, live depth attention heatmaps, training simulation with loss curves, standard vs AttnRes comparison. No GPU required — runs entirely in the browser.
0 commit comments