summaryrefslogtreecommitdiff
path: root/tools/cnn_v2_test/index.html
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-14 00:53:43 +0100
committerskal <pascal.massimino@gmail.com>2026-02-14 00:53:43 +0100
commit1d9f8dafab473e9660614a1970be3a1bfeada0e0 (patch)
treebdc44826653b7d8fbddda8ca69c411bbda456910 /tools/cnn_v2_test/index.html
parent67ada21b34d87c780f42b1af7958dcf831d864ec (diff)
CNN v2 web tool: Fix vizScale for final layer preview
Final layer output is clamped [0,1] and should use vizScale=1.0 like static features, not 0.5 like middle layers (unbounded ReLU). Before: All layers except static used 0.5 (too dark) After: Static + final layer use 1.0, middle layers use 0.5 Fixes brightness mismatch between big preview and thumbnails. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'tools/cnn_v2_test/index.html')
-rw-r--r--tools/cnn_v2_test/index.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/cnn_v2_test/index.html b/tools/cnn_v2_test/index.html
index 622eecc..69336ab 100644
--- a/tools/cnn_v2_test/index.html
+++ b/tools/cnn_v2_test/index.html
@@ -1619,7 +1619,8 @@ class CNNTester {
const layerTex = this.layerOutputs[layerIdx];
if (!layerTex) return;
- const vizScale = layerIdx === 0 ? 1.0 : 0.5;
+ // Use 1.0 for static features and final layer (both clamped [0,1]), 0.5 for middle layers (unbounded)
+ const vizScale = (layerIdx === 0 || layerIdx === this.layerOutputs.length - 1) ? 1.0 : 0.5;
const actualChannel = channelOffset + this.selectedChannel;
const paramsBuffer = this.device.createBuffer({