Move to tanh activation and fix bug in altitude loss term

This commit is contained in:
2025-11-21 15:15:23 +01:00
parent b2ce697abe
commit 8a153691b5
2 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -42,7 +42,8 @@ class HaversineMSEAltitudeLoss(nn.Module):
# Altitude penalty
delta_alt = alt2 - alt1
alt_penalty = self.alt_const * torch.mean(delta_alt ** 2)
delta_alt *= self.alt_const
alt_penalty = torch.mean(delta_alt ** 2)
return haversine_mse + alt_penalty
@@ -83,7 +84,8 @@ class HaversineAltitudeLoss(nn.Module):
# Altitude penalty
delta_alt = alt2 - alt1
alt_penalty = self.alt_const * torch.mean(delta_alt ** 2)
delta_alt *= self.alt_const
alt_penalty = torch.mean(delta_alt ** 2)
return haversine_loss + alt_penalty
+3 -3
View File
@@ -9,9 +9,9 @@ class BaseRNN(nn.Module):
base_unit = lambda in_size, out_size: nn.Sequential(
nn.Linear(in_size, out_size, device=device),
nn.ReLU(),
nn.Tanh(),
nn.Linear(out_size, out_size, device=device),
nn.ReLU(),
nn.Tanh(),
)
self.time_proj = base_unit(time_in, hidden_size)
@@ -42,7 +42,7 @@ class BaseRNN(nn.Module):
readout_in = rnn_size
self.readout = nn.Sequential(
nn.Linear(readout_in, hidden_size, device=device),
nn.ReLU(),
nn.Tanh(),
nn.Linear(hidden_size, out_size, device=device),
)
self.context_in = context_in