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:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user