From 1d9f8dafab473e9660614a1970be3a1bfeada0e0 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 14 Feb 2026 00:53:43 +0100 Subject: 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 --- tools/cnn_v2_test/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') 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({ -- cgit v1.2.3