diff options
Diffstat (limited to 'tools/cnn_v2_test')
| -rw-r--r-- | tools/cnn_v2_test/index.html | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/cnn_v2_test/index.html b/tools/cnn_v2_test/index.html index dd1e42b..2ec934d 100644 --- a/tools/cnn_v2_test/index.html +++ b/tools/cnn_v2_test/index.html @@ -543,12 +543,10 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) { } } - if (is_output) { - output[c] = clamp(sum, 0.0, 1.0); - } else if (params.is_layer_0 != 0u) { - output[c] = clamp(sum, 0.0, 1.0); // Layer 0: clamp [0,1] + if (is_output || params.is_layer_0 != 0u) { + output[c] = 1.0 / (1.0 + exp(-sum)); // Sigmoid [0,1] } else { - output[c] = max(0.0, sum); // Middle layers: ReLU + output[c] = max(0.0, sum); // ReLU } } @@ -1619,7 +1617,8 @@ class CNNTester { const layerTex = this.layerOutputs[layerIdx]; if (!layerTex) return; - const vizScale = layerIdx === 0 ? 1.0 : 0.5; + // Always 1.0, shader clamps to [0,1] - show exact layer values + const vizScale = 1.0; const actualChannel = channelOffset + this.selectedChannel; const paramsBuffer = this.device.createBuffer({ @@ -1884,7 +1883,7 @@ class CNNTester { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; - a.download = `composited_layer${this.currentLayerIdx}_${compositedWidth}x${height}.png`; + a.download = `composited_layer${this.currentLayerIdx - 1}_${compositedWidth}x${height}.png`; a.click(); URL.revokeObjectURL(url); |
