From a3ca42a678c0090e5d4f6b6d5be5782efdd0a225 Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Mon, 13 Apr 2026 14:17:23 +0200 Subject: [PATCH] add comment --- nanochat/gpt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nanochat/gpt.py b/nanochat/gpt.py index 96010419..07a1eae8 100644 --- a/nanochat/gpt.py +++ b/nanochat/gpt.py @@ -237,6 +237,8 @@ class GPT(nn.Module): # Decaying x0 init: earlier layers get more input embedding blending for i in range(n_layer): self.x0_lambdas.data[i] = 0.20 - (0.15 * i / max(n_layer - 1, 1)) + + # Smear/backout scalars and smear gate must be explicitly initialized torch.nn.init.zeros_(self.smear_lambda) torch.nn.init.constant_(self.backout_lambda, 0.2) torch.nn.init.uniform_(self.smear_gate.weight, 0.0, 0.02)