diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/CNN_V2.md | 54 | ||||
| -rw-r--r-- | doc/CNN_V2_WEB_TOOL.md | 19 |
2 files changed, 67 insertions, 6 deletions
diff --git a/doc/CNN_V2.md b/doc/CNN_V2.md index b0aa24c..e56b022 100644 --- a/doc/CNN_V2.md +++ b/doc/CNN_V2.md @@ -32,6 +32,60 @@ Input RGBD → Static Features Compute → CNN Layers → Output RGBA └─ computed once/frame ─┘ └─ multi-pass ─┘ ``` +**Detailed Data Flow:** + +``` + ┌─────────────────────────────────────────┐ + │ Static Features (computed once) │ + │ 8D: p0,p1,p2,p3,uv_x,uv_y,sin10x,bias │ + └──────────────┬──────────────────────────┘ + │ + │ 8D (broadcast to all layers) + ├───────────────────────────┐ + │ │ + ┌──────────────┐ │ │ + │ Input RGBD │──────────────┤ │ + │ 4D │ 4D │ │ + └──────────────┘ │ │ + ▼ │ + ┌────────────┐ │ + │ Layer 0 │ (12D input) │ + │ (CNN) │ = 4D + 8D │ + │ 12D → 4D │ │ + └─────┬──────┘ │ + │ 4D output │ + │ │ + ├───────────────────────────┘ + │ │ + ▼ │ + ┌────────────┐ │ + │ Layer 1 │ (12D input) │ + │ (CNN) │ = 4D + 8D │ + │ 12D → 4D │ │ + └─────┬──────┘ │ + │ 4D output │ + │ │ + ├───────────────────────────┘ + ▼ │ + ... │ + │ │ + ▼ │ + ┌────────────┐ │ + │ Layer N │ (12D input) │ + │ (output) │◄──────────────────┘ + │ 12D → 4D │ + └─────┬──────┘ + │ 4D (RGBA) + ▼ + Output +``` + +**Key Points:** +- Static features computed once, broadcast to all CNN layers +- Each layer: previous 4D output + 8D static → 12D input → 4D output +- Ping-pong buffering between layers +- Layer 0 special case: uses input RGBD instead of previous layer output + **Static Features Texture:** - Name: `static_features` - Format: `texture_storage_2d<rgba32uint, write>` (4×u32) diff --git a/doc/CNN_V2_WEB_TOOL.md b/doc/CNN_V2_WEB_TOOL.md index 81549ab..a5162a6 100644 --- a/doc/CNN_V2_WEB_TOOL.md +++ b/doc/CNN_V2_WEB_TOOL.md @@ -6,7 +6,7 @@ Browser-based WebGPU tool for validating CNN v2 inference with layer visualizati --- -## Status (2026-02-13) +## Status (2026-02-13 evening) **Working:** - ✅ WebGPU initialization and device setup @@ -16,13 +16,20 @@ Browser-based WebGPU tool for validating CNN v2 inference with layer visualizati - ✅ Mode switching (Activations/Weights tabs) - ✅ Canvas context management (2D for weights, WebGPU for activations) - ✅ Weight visualization infrastructure (layer selection, grid layout) +- ✅ Layer naming matches codebase convention (Layer 0, Layer 1, Layer 2) +- ✅ Static features split visualization (Static 0-3, Static 4-7) +- ✅ All layers visible including output layer (Layer 2) -**Not Working:** -- ❌ Layer activation visualization (all black) -- ❌ Weight kernel display (canvases empty, but logging shows execution) +**Recent Fixes:** +- Fixed Layer 2 not appearing (was excluded from layerOutputs due to isOutput check) +- Fixed canvas context switching (force clear before recreation) +- Added Static 0-3 / Static 4-7 buttons to view all 8 static feature channels +- Aligned naming with train_cnn_v2.py/.wgsl: Layer 0, Layer 1, Layer 2 (not Layer 1, 2, 3) +- Disabled Static buttons in weights mode (no learnable weights) -**Partially Working:** -- ⚠️ Texture readback pipeline (UV gradient test works, data reads fail) +**Known Issues:** +- Layer activation visualization may show black if texture data not properly unpacked +- Weight kernel display depends on correct 2D context creation after canvas recreation --- |
