summaryrefslogtreecommitdiff
path: root/tools/cnn_v2_test/index.html
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-13 16:57:29 +0100
committerskal <pascal.massimino@gmail.com>2026-02-13 16:57:29 +0100
commit0793c20c1dd0c5f0c535f7da90337081939b2cfc (patch)
tree86f708033d93d19470e1b016e5abe52e07b340a8 /tools/cnn_v2_test/index.html
parent4c21145ce5e408dd38e8374eed320fcfac97c0c4 (diff)
CNN v2: Change feature #6 from sin(10*x) to sin(20*y)
Update positional encoding to use vertical coordinate at higher frequency. Changes: - train_cnn_v2.py: sin10_x → sin20_y (computed from uv_y) - cnn_v2_static.wgsl: sin10_x → sin20_y (computed from uv_y) - index.html: sin10_x → sin20_y (STATIC_SHADER) - CNN_V2.md: Update feature descriptions and examples - CNN_V2_BINARY_FORMAT.md: Update static features documentation Feature vector: [p0, p1, p2, p3, uv_x, uv_y, sin20_y, bias] Rationale: Higher frequency (20 vs 10) + vertical axis provides better spatial discrimination for position encoding. 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.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/cnn_v2_test/index.html b/tools/cnn_v2_test/index.html
index 88c4733..cab20ea 100644
--- a/tools/cnn_v2_test/index.html
+++ b/tools/cnn_v2_test/index.html
@@ -414,13 +414,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
let d = textureLoad(depth_tex, coord, 0).r;
let uv_x = f32(coord.x) / f32(dims.x);
let uv_y = 1.0 - (f32(coord.y) / f32(dims.y));
- let sin10_x = sin(10.0 * uv_x);
+ let sin20_y = sin(20.0 * uv_y);
let packed = vec4<u32>(
pack2x16float(vec2<f32>(rgba.r, rgba.g)),
pack2x16float(vec2<f32>(rgba.b, d)),
pack2x16float(vec2<f32>(uv_x, uv_y)),
- pack2x16float(vec2<f32>(sin10_x, 1.0))
+ pack2x16float(vec2<f32>(sin20_y, 1.0))
);
textureStore(output_tex, coord, packed);
}`;