fix: normalizza x in forward() dividendo per L

Rende la normalizzazione degli input simmetrica: x/L e t/T_END
entrambi in [0,1], indipendentemente dal valore di L in config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-14 16:08:18 +02:00
parent f94fd51942
commit 5a8cd3ef46
+1 -2
View File
@@ -14,8 +14,7 @@ class HeatPINN(nn.Module):
self.net = nn.Sequential(*layers)
def forward(self, xt):
# Normalize t to [0,1] to avoid Tanh saturation for large t values (up to T_END)
x = xt[:, :1]
x = xt[:, :1] / config.L
t = xt[:, 1:] / config.T_END
return config.T_AMB + (config.Q_VAL * config.L / config.K) * self.net(torch.cat([x, t], dim=1))