summaryrefslogtreecommitdiff
path: root/tools/cnn_v2_test/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cnn_v2_test/index.html')
-rw-r--r--tools/cnn_v2_test/index.html8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/cnn_v2_test/index.html b/tools/cnn_v2_test/index.html
index 1dd2e78..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
}
}