From 37df61d1a0dbd5e253f9db778c17c4187e453b8d Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 27 Mar 2026 08:41:05 +0100 Subject: fix(cnn_v3): L1 loss + depth-grad tanh normalization to reduce flat convergence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Switch MSELoss → L1Loss in train_cnn_v3.py (median-seeking, avoids gray-blob) - Normalize depth_grad channels with tanh(10x) in cnn_v3_utils.py (bounds ±∞ signed values) - Match normalization in gbuf_pack.wgsl: tanh((right-left)*5.0) == tanh(10*central_diff) handoff(Gemini): training pipeline only; no C++ or test changes needed. --- cnn_v3/training/cnn_v3_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cnn_v3/training/cnn_v3_utils.py') diff --git a/cnn_v3/training/cnn_v3_utils.py b/cnn_v3/training/cnn_v3_utils.py index 68c0798..bd0ca2f 100644 --- a/cnn_v3/training/cnn_v3_utils.py +++ b/cnn_v3/training/cnn_v3_utils.py @@ -140,7 +140,7 @@ def assemble_features(albedo: np.ndarray, normal: np.ndarray, mip1 = _upsample_nearest(pyrdown(albedo), h, w) mip2 = _upsample_nearest(pyrdown(pyrdown(albedo)), h, w) - dgrad = depth_gradient(depth) + dgrad = np.tanh(depth_gradient(depth) * 10.0) if prev is None: prev = np.zeros((h, w, 3), dtype=np.float32) nor3 = oct_decode(normal) -- cgit v1.2.3